Loading AWD Problem

Software: Away3D 4.x

Sellew, Newbie
Posted: 08 September 2012 12:48 PM   Total Posts: 7

Hi all,

I am pretty new to Away3D and I wonder how to load the AWD file that I exported from 3dsMax 2012 using the Away3d Exporter Plug-In. I found a tutorial doing exactly what I want and I downloaded the code to try it out.

http://www.adobe.com/devnet/flashplayer/articles/creating-games-away3d.html

However, it doesn’t work. After a few hours of trail and error, I finally got the code working. The solution is to change the Away3D library from 4.0.9 Gold to 4.0.110915 Alpha, then the 3d model finally showed up! 
 
However, when I changed to the my awd file, it doesn’t work! DAMN!!!!
 
Anyone knows what is going on? Bugs in 4.0? Or they just changed the way to load awd in the new release?

Many thanks!!!

package
{
 import away3d
.containers.View3D;
 
import away3d.events.LoaderEvent;
 
import away3d.loaders.Loader3D;
 
import away3d.loaders.parsers.Parsers;
 
import away3d.primitives.WireframeCube;
 
import away3d.library.AssetLibrary;
 
import away3d.events.AssetEvent;
  
 
import flash.display.Sprite;
 
import flash.events.Event;
 
import flash.net.URLRequest;
 
 
[SWF(width="800"height="600")]
 
public class GettingStartedWithAway3D extends Sprite
 {
  
private var _view View3D;
  private var 
_loader Loader3D;
  private var 
cube:WireframeCube;
  
  public function 
GettingStartedWithAway3D()
  
{
   _view 
= new View3D();
   
_view.backgroundColor 0x666666;
   
_view.antiAlias 4;
   
   
this.addChild(_view);
   
this.addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
   
//I draw a cube to see know the code is still run well when the awd object doesn't appear
   
cube = new WireframeCube(2002002000xFF00001);
   
_view.scene.addChild(cube);
   
   
Parsers.enableAllBundled();
      
   
trace("init loader");
   
_loader = new Loader3D(falsenull);
   
   
//awd object provide by the tutorial, works only in Away3D 4.0.110915 Alpha
   //_loader.load(new URLRequest('vase.awd'));
   
   //my awd object, doesn't work!
   
_loader.load(new URLRequest('building_v3.AWD') );
   
   
_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
   
_loader.addEventListener(LoaderEvent.LOAD_ERRORonLoadError);  
  
}
  
  
private function onResourceComplete(ev LoaderEvent) : void
  {
   _loader
.removeEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
   
_loader.removeEventListener(LoaderEvent.LOAD_ERRORonLoadError);
   
_view.scene.addChild(_loader);
  
}
  
  
  
private function onLoadError(ev LoaderEvent) : void
  {
   trace
('Could not find'ev.url);
   
_loader.removeEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
   
_loader.removeEventListener(LoaderEvent.LOAD_ERRORonLoadError);
   
_loader null;
  
}
  
  
  
private function onEnterFrame(ev Event) : void
  {
   _loader
.rotationY stage.mouseX stage.stageWidth/2;
   
_view.camera.* (stage.mouseY stage.stageHeight/2);
   
_view.camera.lookAt(_loader.position);
   
   
_view.render();
  
}
 }

 

   

Avatar
Fabrice Closier, Administrator
Posted: 08 September 2012 01:02 PM   Total Posts: 1265   [ # 1 ]

if you can load your awd2 with material in alpha, this means that you do not use the latest 2.0 awd exporter. If you use the latest exporters, and latest Away. You should be able to load them. Note that Prefab could solve your problems here…

   

Sellew, Newbie
Posted: 09 September 2012 05:34 PM   Total Posts: 7   [ # 2 ]

Thanks for your help, I import and export the awd file in Prefab and I can now load the awd.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X