There is something wrong in the onModelLoadComplete function.
After commenting out certain stuff, I have figured that there is some problem with these lines (look at the comments in source code).
But I can not figure out what exactly the problem is.
It does not give any error but the model does not load.
Also note that the model is working as I used a Loader3D to load it before and managed to add it succesfully to the scene using addChild(_loader) funtion. But I decided to use AssetLibrary but now I do not know how to add the .awd model to the stage.
private function iniObjects():void
{
AssetLibrary.enableParser(AWD2Parser);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onModelLoadComplete);
AssetLibrary.addEventListener(LoaderEvent.LOAD_ERROR, onModelLoadError);
AssetLibrary.load(new URLRequest('myModel2.awd'));
}
private function onModelLoadComplete(ev:LoaderEvent) : void
{
AssetLibrary.removeEventListener(AssetEvent.ASSET_COMPLETE, onAssetComplete);
AssetLibrary.removeEventListener(LoaderEvent.RESOURCE_COMPLETE, onModelLoadComplete);
AssetLibrary.removeEventListener(LoaderEvent.LOAD_ERROR, onModelLoadError);
_container = new ObjectContainer3D();
_mesh2 = AssetLibrary.getAsset('myModel2') as Mesh; //POSSIBLE ERROR
_container.addChild(_mesh2);//POSSIBLE ERROR
_view.scene.addChild(_container);
}