Loader in flash CS5 AS3 help?

Ian Murray

New member
So im trying to make a loader cause my flash file is getting to big. i made a new project and instered the following code:

var l:Loader = new Loader();



l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);



l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);



l.load(new URLRequest("Black Rose I Demo.swf"));



function loop(e:ProgressEvent):void



{



var perc:Number = e.bytesLoaded / e.bytesTotal;



percent.text = Math.ceil(perc*100).toString()+"%";



}







function done(e:Event):void



{



for(var i:uint = 0; i < numChildren;i++){


trace("CHILD:"+getChildAt(i).name);


removeChildAt(0);


}


addChild(l);


var movie:* = l.content;


movie.play();


}

When i run it it writes the traces i have in the main movie but all i see is the text form the loader and no change int he dynamic text box named percent. Help?
 
Back
Top