home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / planetx.swf / scripts / frame_17 / DoAction_12.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  1000 b   |  45 lines

  1. function escapepodClass()
  2. {
  3. }
  4. escapepodClass.prototype = new MovieClip();
  5. escapepodClass.prototype.onLoad = function()
  6. {
  7.    this.x = this._x;
  8.    this.y = this._y;
  9.    this.state = "normal";
  10. };
  11. escapepodClass.prototype.onEnterFrame = function()
  12. {
  13.    if(_root.state == "paused")
  14.    {
  15.    }
  16.    if(_root.state == "playing")
  17.    {
  18.       if(this.state == "normal")
  19.       {
  20.          if(this.hitTest(_root.player) == true)
  21.          {
  22.             podCollected();
  23.             this.state = "start collected";
  24.             escapeCSnd.start();
  25.          }
  26.       }
  27.       if(this.state == "start collected")
  28.       {
  29.          this.counter = 15;
  30.          this.state = "collected wait";
  31.          this.gotoAndPlay(2);
  32.       }
  33.       if(this.state == "collected wait")
  34.       {
  35.          this.counter--;
  36.          this._alpha -= 6;
  37.          if(this.counter < 1)
  38.          {
  39.             removeMovieClip(this);
  40.          }
  41.       }
  42.    }
  43. };
  44. Object.registerClass("escapePod",escapepodClass);
  45.