1 Reply Latest reply on Sep 15, 2014 1:23 PM by kglad

    file download speed test

    dazzfazz

      Hi,

       

      This will be sooo easy for someone, Im just not that someone.

       

      Im trying to work out the speed a file downloads from a remote hosting server to my Flash application but for the life of me, I cannot work out the calculation.

       

      Any help with this one would be very much appreciated.

       

      Thanks

        • 1. Re: file download speed test
          kglad Adobe Community Professional & MVP

          var target_mc:MovieClip=this.createEmptyMovieClip("target_mc",this.getNextHighestDepth());

           

          var startTime:Number=getTimer();

          target_mc.loadMovie('testfile.swf");

          this.onEnterFrame=function():Void{

          // dl_speed=1000*target_mc.getBytesLoaded()/(getTimer()-startTime);  // bytes per second.  if you want kb/s, divide by 1024.

          if(target_mc.getBytesLoaded()>0&&target_mc.getBytesLoaded()==target_mc.getBytesTotal(){

          delete this.onEnterFrame;

          }

          }

           

          p.s. using the moviecliploader class may allow a slightly more accurate estimate.