AssetEvent : how can i know when loading a model is completed

Software: Away3D 4.x

aeki, Member
Posted: 25 September 2012 04:32 PM   Total Posts: 73

I am using AssetLibrary with AWD parser.

I need to know when a model (usually a container with several meshes) is completly loaded.

I’ve registrered all the assetEvents and traced them, but none of them seems to be fired when the loading is finished…

Any clue?

   

aeki, Member
Posted: 25 September 2012 04:53 PM   Total Posts: 73   [ # 1 ]

ok, i’ve found the answer.

The class AssetLoaderToken allows to listen to the LoaderEvent.RESOURCE_COMPLETE, which is fired when the loading is finished

var ldr:AssetLoaderToken AssetLibrary.load(new URLRequest('my/Path/to/AWD.AWD'),null,null,new AWDParser);

ldr.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete); 
   

Richard Olsson, Administrator
Posted: 25 September 2012 06:36 PM   Total Posts: 1192   [ # 2 ]

You don’t have to use an AssetLoaderToken though. You can listen for the RESOURCE_COMPLETE directly on the loader/library, although it will of course then be dispatched for every resource (load operation) that finishes.

   

aeki, Member
Posted: 26 September 2012 02:48 PM   Total Posts: 73   [ # 3 ]

Thanks for thetip , even better for what i need to do!!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X