0 Replies Latest reply on Jan 9, 2017 6:17 AM by jackh8500410

    Unable to Simulate Download

    jackh8500410 Level 1

      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