home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / avenger.swf / scripts / DefineSprite_164 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  763 b   |  36 lines

  1. _root.stop();
  2. Stage.scaleMode = "noScale";
  3. fscommand("trapallkeys",true);
  4. Stage.showMenu = false;
  5. this.sg = [];
  6. for(var i in this)
  7. {
  8.    if(this[i]._totalframes == 1)
  9.    {
  10.       this.sg.push(this[i]);
  11.       this[i]._alpha = 20;
  12.    }
  13. }
  14. this._tm = getTimer();
  15. this.onEnterFrame = function()
  16. {
  17.    var ld = _root.getBytesLoaded();
  18.    var tt = _root.getBytesTotal();
  19.    this.bytes = ld;
  20.    this.procent = tt <= 0 ? 0 : 100 * ld / tt;
  21.    this.time = (getTimer() - this._tm) / 1000;
  22.    this.transfer = this.bytes / this.time;
  23.    var pr = Math.floor(this.procent);
  24.    var i = 100;
  25.    while(i > 100 - pr)
  26.    {
  27.       this.sg[i]._alpha = 40;
  28.       i--;
  29.    }
  30.    if(pr >= 100)
  31.    {
  32.       this.onEnterFrame = null;
  33.       _root.play();
  34.    }
  35. };
  36.