home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / terrain.swf / scripts / DefineSprite_18 / frame_2 / DoAction.as
Encoding:
Text File  |  2007-03-20  |  572 b   |  28 lines

  1. b_loaded = _root.getBytesLoaded();
  2. b_total = _root.getBytesTotal();
  3. time = getTimer() / 1000 - time1;
  4. bps = b_loaded / time;
  5. b_left = b_total - b_loaded;
  6. s_left = Math.ceil(b_left / bps);
  7. min = Math.floor(s_left / 60);
  8. if(min >= 1)
  9. {
  10.    s_left -= Math.floor(min * 60);
  11.    if(s_left < 10)
  12.    {
  13.       s_left = "0" add s_left;
  14.    }
  15. }
  16. else
  17. {
  18.    min = "0";
  19.    if(s_left < 10)
  20.    {
  21.       s_left = "0" add s_left;
  22.    }
  23. }
  24. timeleft = min add ":" add s_left;
  25. bit_rate = int(bps) add "bps";
  26. percent = b_loaded / b_total * 100;
  27. _root.bar._xscale = percent;
  28.