Skip to main content
Inspiring
January 9, 2017
Question

Unable to Simulate Download

  • January 9, 2017
  • 0 replies
  • 145 views

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

This topic has been closed for replies.