Copy link to clipboard
Copied
Hi All,
Just used to Preloader function to create a loading bar at the start of my flash file.
I've seen that the Simulate download has been removed from the Animate package, but I wonder if theres a way to do this?
There's nothing huge in my file to make it load for a long time, but I want to make sure it's working.
My code:
stop();
//check file size left
this.addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event):void{
var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;
bar_mc.scaleX = loaded/total;
loader_txt.text = Math.floor((loaded/total)*100)+ "%";
if (total == loaded){
play();
this.removeEventListener(Event.ENTER_FRAME, loading);
}
}
Thanks,
Jack
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now