Hey,
I’m not sure where to post this so I posted it in the Flash CS3 forum and I’m posting it here.
I am trying to create a preloader for all the external swf files I want to use in my modular flash site and it’s not working very well. When I simply test the movie, everything works great. When I simulate the download it goes through the whole preloader and gets up to 100% (in the dynamic text field mBpc_txt) then nothing loads up. When I publish the movie to html, it goes to 0% and doesn’t move any further. Any sort of advice would be greatly appreciated. Here’s the code I’m using:
var mBRequest:URLRequest = new URLRequest ("marchingBand.swf");
var myloader:Loader = new Loader();
myloader.load(mBRequest);
myloader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progresshandler);
function progresshandler(myevent:ProgressEvent):void {
var myprogress:Number = myevent.target.bytesLoaded/myevent.target.bytesTotal;
mBpc_txt.text = Math.round(myprogress*100) + "%"
}
myloader.contentLoaderInfo.addEventListener(Event.COMPLETE, alldone);
function alldone(myevent:Event):void {
container.addChild(myloader);
removeChild(mBpc_txt)
}
Thanks so much!
Dave