home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / Sonic-The-Hedgehog.swf / scripts / frame_2 / DoAction.as
Encoding:
Text File  |  2005-11-10  |  1.4 KB  |  40 lines

  1. objNewTime = new Date();
  2. varBytes = _root.getBytesLoaded();
  3. varKbytes = Math.round(_root.getBytesLoaded() / 1024 * 100) / 100;
  4. varTotalBytes = Math.round(_root.getBytesTotal() / 1024 * 100) / 100;
  5. if(1024 < varBytes)
  6. {
  7.    txtBytes = varKbytes add " Kbytes of " add varTotalBytes add " Kbytes";
  8. }
  9. else
  10. {
  11.    txtBytes = varBytes add " Bytes of " add varTotalBytes add " Kbytes";
  12. }
  13. txtPercentage = Math.round(_root.getBytesLoaded() / _root.getBytesTotal() * 100) add "%";
  14. varElapsedSeconds = objNewTime.getSeconds() - varStartSeconds;
  15. varElapsedMinutes = objNewTime.getMinutes() - varStartMinutes;
  16. varElapsedHours = objNewTime.getHours() - varStartHours;
  17. varElapsedDays = objNewTime.getDay() - varStartDays;
  18. varElapsedTime = varElapsedDays * 24 * 60 * 60 + varElapsedHours * 60 * 60 + varElapsedMinutes * 60 + varElapsedSeconds;
  19. if(1 < varElapsedTime)
  20. {
  21.    txtElapsed = varElapsedTime add " Seconds";
  22. }
  23. else
  24. {
  25.    txtElapsed = varElapsedTime add " Second";
  26. }
  27. varSpeed = Math.round(_root.getBytesLoaded() / varElapsedTime / 1024 * 10) / 10;
  28. txtSpeed = varSpeed add " Kbytes/Second";
  29. varRemaining = Math.round((_root.getBytesTotal() - _root.getBytesLoaded()) / (varSpeed * 1024));
  30. if(1 < varRemaining)
  31. {
  32.    txtRemaining = varRemaining add " Seconds";
  33. }
  34. else
  35. {
  36.    txtRemaining = varRemaining add " Second";
  37. }
  38. varMove = Math.Round(_root.getBytesLoaded() / _root.getBytesTotal() * 458.8);
  39. setProperty("_root.mcLoad", _X, -59.4 + varMove);
  40.