when the model assets loaded, trace it’s name.
trace:
assets loadedobj0
assets loadedobj1
assets loadedobj2
assets loadedobj3
assets loadedobj4
assets loadedobj5
GRWorld model loaded
But there are 5 mesh, I only want get an Mesh(the model object) and put it to scene.
How can I should do? And I have a list of .obj files need load.
I know AssetLibrary only care assets not resource, but how can I get the resource after loaded?
protected function init():void {
Parsers.enableAllBundled();
_models = new Vector.<Obj3d>();
_assetsLib = AssetLibrary.getInstance();
_assetsLib.parseData(_model);
_assetsLib.addEventListener(LoaderEvent.RESOURCE_COMPLETE, modelLoaded);
_assetsLib.addEventListener(AssetEvent.ASSET_COMPLETE, assetLoaded);
}
private function assetLoaded(e:AssetEvent):void
{
trace("assets loaded"+e.asset.name)
}
private function modelLoaded(e:LoaderEvent):void
{
dispatchEvent(new Event("modelLoaded"));
}