Just tried swapping to assetLibrary. Doing the same loading two awd1 files.
So have to use the namespace parameter.
Using
Loader3D.enableParser(AWD1Parser);
AssetLibrary.load(new URLRequest(CAB_URL),new AWD1Parser(),null,'dafCab');
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE,
onLoadComplete);
AssetLibrary.load(new URLRequest(TRAILER_URL),new
AWD1Parser(),null,'containerTrailer');
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETE,
onLoadComplete);
private function onLoadComplete(e:LoaderEvent):void
{
if (e.url == CAB_URL)
{
var dafCabPivot: ObjectContainer3D =
ObjectContainer3D(AssetLibrary.getAsset('main','dafCab'));
view.scene.addChild(dafCabPivot);
trace("dafCabPivot.position "+dafCabPivot.position);
}
if (e.url == TRAILER_URL)
{
var trailerContainer: ObjectContainer3D =
ObjectContainer3D(AssetLibrary.getAsset('main','containerTrailer'));
view.scene.addChild(trailerContainer);
trailerContainer.moveForward(130)
trailerContainer.rotationY = 180;
trace("trailerContainer.position "+trailerContainer.position);
}
}
The above would trace
trailerContainer.position Vector3D(0, 0, 130)
dafCabPivot.position Vector3D(0, 0, 0)
Which is expected and works fine.
So I thought do really need to check the url anymore if I'm using an
assetLibrary and removed the
if (e.url == CAB_URL) & if (e.url == TRAILER_URL) but now the position is
wrong.
traces
dafCabPivot.position Vector3D(0, 0, 0)
trailerContainer.position Vector3D(0, 0, 130)
dafCabPivot.position Vector3D(0, 0, 0)
trailerContainer.position Vector3D(0, 0, 0)
Is that the expected behaviour?