|
Josh, Newbie
Posted: 24 July 2012 07:36 AM Total Posts: 24
Hi,
Can somebody help me, i have a “Map.awd” file from my database. I want to load my file to my stage. When i try to load it. the loading process was not completed. and the mesh loaded was not appearing to my stage.
Can someone encounter this problem before.
Hoping for the reply.
Thanx,
Josh
|
Richard Olsson, Administrator
Posted: 24 July 2012 08:26 AM Total Posts: 1192
[ # 1 ]
Can you explain how you are trying to load it? A little code might help us to spot simple mistakes straight away.
|
Josh, Newbie
Posted: 24 July 2012 08:39 AM Total Posts: 24
[ # 2 ]
Hi Richard,
Thanx for fast reply. Kindly refer to the code below.
_loader3D2.addEventListener(LoaderEvent.RESOURCE_COMPLETE, completedMap);
_loader3D2.addEventListener(LoaderEvent.LOAD_ERROR, errorLoaded); _loader3D2.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetLoaded); _loader3D2.load(new URLRequest(_baseUrl + "/images/original/Map.awd"));
private function completedMap(evt:LoaderEvent):void { try { trace("completedMap") _loader3D2.removeEventListener(LoaderEvent.RESOURCE_COMPLETE, completedMap);
_loader3D2.removeEventListener(LoaderEvent.LOAD_ERROR, errorLoaded); _view3D.scene.addChild(_loader3D2); } catch (e:Error) { trace("Map Error Loading " + e.message); } }
private function onAssetLoaded(evt:AssetEvent):void { try { trace("Received asset type " + evt.asset.assetType); switch(String(evt.asset.assetType)) { case AssetType.MESH: _mesh = new Mesh(); _mesh = evt.asset as Mesh; _mesh.mouseEnabled = true; _mesh.addEventListener(MouseEvent3D.CLICK, onMouseClick); _mesh.addEventListener(MouseEvent3D.MOUSE_OUT, onMouseOut); trace("Mesh: " + _mesh.name); trace("Submesh:" + _mesh.subMeshes.length); for each(var sg:SubGeometry in _mesh.geometry.subGeometries) { sg.autoDeriveVertexNormals = true; sg.autoDeriveVertexTangents = true; } for each(var sm:SubMesh in _mesh.subMeshes) { _material = new ColorMaterial(0xFFFFFF * Math.random()); sm.material = _material; _mesh.material = _material; sm.material.lightPicker = _staticLightPicker; } break; case AssetType.TEXTURE: break; case AssetType.MATERIAL: if (evt.asset is TextureMaterial) { _mapTexture = evt.asset as TextureMaterial; (_mapTexture as TextureMaterial).smooth = true; (_mapTexture as TextureMaterial).repeat = false; (_mapTexture as TextureMaterial).specularColor = 0x0; (_mapTexture as TextureMaterial).specular = 1; (_mapTexture as TextureMaterial).ambientColor = 0x0; (_mapTexture as TextureMaterial).ambient = 1; (_mapTexture as TextureMaterial).gloss = 100; (_mapTexture as TextureMaterial).bothSides = false; (_mapTexture as TextureMaterial).alphaThreshold = 0; (_mapTexture as TextureMaterial).blendMode = "normal"; (_mapTexture as TextureMaterial).animateUVs = false; (_mapTexture as TextureMaterial).alpha = 1; (_mapTexture as TextureMaterial).name = "mato"; (_mapTexture as TextureMaterial).mipmap = true; (_mapTexture as TextureMaterial).alphaBlending = false; (_mapTexture as TextureMaterial).lightPicker = _staticLightPicker; (_mapTexture as TextureMaterial).diffuseLightSources = LightSources.LIGHTS; trace("mapTexture " + _material); } else { trace("ColorMaterial"); } }
private function errorLoaded(evt:LoaderEvent):void { trace('Could not find', evt.url); _loader3D2.removeEventListener(LoaderEvent.RESOURCE_COMPLETE, completedMap); _loader3D2.removeEventListener(LoaderEvent.LOAD_ERROR, errorLoaded); _loader = null; }
hope you can help me.
thanx again
|
Richard Olsson, Administrator
Posted: 24 July 2012 08:48 AM Total Posts: 1192
[ # 3 ]
And what goes wrong? You have a lot of logging in there, so maybe you could tell us how far it gets? Are any asset events dispatched? Is the RESOURCE_COMPLETE or the LOAD_ERROR event dispatched?
Please take some time to explain the issue.
|
Josh, Newbie
Posted: 24 July 2012 08:58 AM Total Posts: 24
[ # 4 ]
Hi,
onComplete
Received asset type container
Received asset type geometry
Received asset type mesh
Mesh: Booth_314
Submesh:1
Received asset type geometry
Received asset type mesh
Mesh: Booth_315
Submesh:1
Received asset type geometry
That’s the result when i compile the program.
Only 2 Mesh are complete. I have more than 30 meshes on my map. And that two mesh didnt appear on my stage. That’s my problem. When i load “.Obj” file, they can load easily and appear on my stage. I dont know where’s the problem.
Regards,
Josh
|
Richard Olsson, Administrator
Posted: 24 July 2012 09:02 AM Total Posts: 1192
[ # 5 ]
Where is this AWD file coming from? What version of Away3D are you using (refer to the constants in the away3d.Away3D class.)?
|
Josh, Newbie
Posted: 24 July 2012 09:19 AM Total Posts: 24
[ # 6 ]
Hi,
I’m using the new version of Away3d file. i downloaded last sunday july 22,2012 from the github. I like to attached the AWD im using. but the file was exceeded to your max kb.
Regards,
Josh
|
Richard Olsson, Administrator
Posted: 24 July 2012 09:21 AM Total Posts: 1192
[ # 7 ]
And where is the AWD file coming from?
|
Josh, Newbie
Posted: 24 July 2012 09:28 AM Total Posts: 24
[ # 8 ]
Hi,
The file to be load will be coming from database. Then, will be load to stage
|
Richard Olsson, Administrator
Posted: 24 July 2012 09:32 AM Total Posts: 1192
[ # 9 ]
Ok, let me rephrase that question. What program did you use to generate the AWD file? Is it AWD1 (plaintext) or AWD2 (binary)?
Also, can you put up the AWD file online somewhere so that I can download it and test it?
|
Josh, Newbie
Posted: 24 July 2012 09:45 AM Total Posts: 24
[ # 10 ]
Hi,
It was generated on AWD2. You can download my AWD file on this link
https://www.dropbox.com/s/svyzm46ygo2kimv/Map3DAWD2.awd.
Note, Save the file first into your database. Loading that file in external file was easy. The problem is from database to stage.
Thanx,
Josh
|
Richard Olsson, Administrator
Posted: 24 July 2012 09:49 AM Total Posts: 1192
[ # 11 ]
That AWD2 file doesn’t work for me. What program did you use to generate it? Prefab? 3ds Max? Maya? Something else?
|
Josh, Newbie
Posted: 24 July 2012 09:51 AM Total Posts: 24
[ # 12 ]
|
Richard Olsson, Administrator
Posted: 24 July 2012 09:53 AM Total Posts: 1192
[ # 13 ]
And what version of Prefab, exactly?
|
Josh, Newbie
Posted: 24 July 2012 10:02 AM Total Posts: 24
[ # 14 ]
Version 2, Is there something wrong? You cannot open my AWD file?
|
Richard Olsson, Administrator
Posted: 24 July 2012 10:05 AM Total Posts: 1192
[ # 15 ]
What exact version of Prefab are you using? Please provide the full 2.XXX version number.
I cannot load your AWD file. Can you please provide both the full Prefab version number, as well as the version number given in the Away3D class constants found in the away3d package, by doing, for example the following:
trace(away3d.Away3D.MAJOR_VERSION, away3d.Away3D.MINOR_VERSION, away3d.Away3D.REVISION);
Please answer both questions:
- What is the full 2.xxx Prefab version number?
- What is the full 4.x.x Away3D version number?
|