Here is an update. I found that I can't set the text for the textBox
in the loadProgress function I've created. I can only set it once the
Event.Complete event has been called on the collada loader. Here is
the code.
public function Main ( )
{
this.loader = new ColladaLoader ( ) ;
this.stage.align = StageAlign.TOP_LEFT ;
this.stage.scaleMode = StageScaleMode.NO_SCALE ;
loader.addEventListener ( Event.COMPLETE ,
this.loadComplete ) ;
loader.addEventListener ( ProgressEvent.PROGRESS,
this.loaderProgress );
loader.load ( new URLRequest ( "models/world.dae" ) ) ;
}
protected function loaderProgress ( event : ProgressEvent )
{
var loadedBytes:Number = event.bytesLoaded;
var totalBytes:Number = event.bytesTotal;
displayInfo.text = "Loading Models - please wait:
"+"Bytes Loaded:
"+ loadedBytes+" of "+totalBytes+" Total Bytes";
if(loadedBytes == totalBytes)
{
displayInfo.text = "";
}
}
protected function loadComplete (event:Event) : void
{
var loader : ColladaLoader = event.target as
ColladaLoader ;
this.world = new WorldBuilder ( ) ;
this.world.data = loader.collada ;
this.world.startCamera = "overviewCam" ;
this.world.addEventListener ( Event.COMPLETE ,
this.worldComplete ) ;
this.addChild ( this.world ) ;
//Swap Depth with HUD
this.setChildIndex(this.world,0);
this.displayInfo.text = "This will set the text of the
textBox at
this point";
this.world.build ( ) ;