Hi ,
I´m new to Away3d and trying to load some .obj assets with AssetLibrary.as.
But i cant figure out, how to differentiate between multiple .obj assets in the Asset_Complete callback function. As far as i can see, it is not possible to name the meshes from the .obj´s.
Currently i´m doing this :
assetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, assetComplete);
assetLibrary.loadData(new puckMesh(), assetLibraryContext,“someNS1”);
assetLibrary.loadData(new puckMesh(), assetLibraryContext,“someNS2”);
then in the callback
protected function assetComplete(event:AssetEvent):void {
switch(event.asset.assetNamespace)
{
case “someNS1” : trace(“someNS1”);
case “someNS2” : trace(“someNS2”);
}
}
What is the right way to handle this ?
Thanks in advance