Fire event after asset is finished loading?

Software: Away3D 4.x

Avatar
projoaw, Newbie
Posted: 27 October 2011 09:42 AM   Total Posts: 1

Hi,

I’m trying to load an external file and detect when it has finished loading.

The object has several meshes (imagine for example the Ferrari that comes within Away examples : Body + Wheel1 + Wheel2 + Wheel3 + Wheel4)

I’m using AssetLibrary.load() for loading it, but I can’t find a suitable event to listen to for when the FULL object has finished loading. I see there are several events but none of them seem to do the job.

How can I setup an event to know when the full file has been processed (including all its dependencies)

Thanks very much!

   

michel, Newbie
Posted: 27 October 2011 10:20 AM   Total Posts: 10   [ # 1 ]

U can use this one:

AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onResourceComplete);

   

wagster, Member
Posted: 28 October 2011 06:56 PM   Total Posts: 68   [ # 2 ]

There’s also an AssetLibrary.ASSET_COMPLETE event that’s fired every time an asset (material, mesh etc) has completed loading within the resource that you are loading (a resource is the loaded file, plus all the dependent files - some formats save models in a number of connected files).

There’s a good article by Richard Olsson here:

http://away3d-dev.googlegroups.com/attach/8cfd22f346426ad5/LoadingInAway4.pdf?view=1&part=2

which explains loading better than I can.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X