AssetLibrary.addEventListener in Away3D 4.0.9 seems unlogic and incompatible with provided examples

Software: Away3D 4.x

aeki, Member
Posted: 20 September 2012 01:59 PM   Total Posts: 73

I don’t understand how to use the AssetLibrary in Away3D 4.0.9 Gold.

The example Intermediate_LightProbes do not compile with Away3D 4.0.9 Gold

In particular i don’t understand the logic of the addEventListener method which arguments are described in the doc as

public static function addEventListener(type:Stringlistener:Function, useCapture:Boolean falsepriority:int 0useWeakReference:Boolean false):void 

instead of something like this as used in the example Intermediate_LightProbes

AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETEonAssetComplete); 

Why the following code, which is syntaxly valid, does not load any object (the var mesh is always null) ?

AssetLibrary.enableParser(AWDParser);
AssetLibrary.addEventListener('AssetComplete',onAssetComplete);
AssetLibrary.addEventListener('RessourceLoad'onRessourceLoaded);
AssetLibrary.load( new URLRequest('myObject.AWD'));
var 
mesh Mesh Mesh(AssetLibrary.getAsset('MyObject001'));
addChild(mesh); 
   

aeki, Member
Posted: 22 September 2012 05:35 AM   Total Posts: 73   [ # 1 ]

Sorry for my question, i couldn’t believe that the Intermediate_LightProbes example could be compiled, but just trying to showed me I was wrong.


AssetLibrary do have a standard addEventListener method which seems Logic to me.

However, i don’t understand why the AssetLibrary class method
   

addEventListener(type:Stringlistener:Function, useCapture:Boolean falsepriority:int 0useWeakReference:Boolean false):void 


Is a short-hand to add an event listener…

 

   

aeki, Member
Posted: 22 September 2012 05:37 AM   Total Posts: 73   [ # 2 ]

Sorry for my question, i couldn’t believe that the Intermediate_LightProbes example could be compiled, but just trying to showed me I was wrong.


AssetLibrary do have a standard addEventListener method which seems logic to me.

However, i don’t understand why the AssetLibrary class method
   

addEventListener(type:Stringlistener:Function, useCapture:Boolean falsepriority:int 0useWeakReference:Boolean false):void 


Is a short-hand to add an event listener…

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X