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

  1. function miniCollectClass()
  2. {
  3. }
  4. miniCollectClass.prototype = new MovieClip();
  5. miniCollectClass.prototype.onLoad = function()
  6. {
  7.    this.x = this._x;
  8.    this.y = this._y;
  9.    this.state = "normal";
  10. };
  11. miniCollectClass.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.             miniCollected(this.clip.typeOf);
  23.             this.state = "start collected";
  24.          }
  25.       }
  26.       if(this.state == "start collected")
  27.       {
  28.          this.counter = 15;
  29.          this.state = "collected wait";
  30.          this.clip.gotoAndPlay(2);
  31.       }
  32.       if(this.state == "collected wait")
  33.       {
  34.          this.counter--;
  35.          this._alpha -= 5;
  36.          if(this.counter < 1)
  37.          {
  38.             removeMovieClip(this);
  39.          }
  40.       }
  41.    }
  42. };
  43. Object.registerClass("miniCollect",miniCollectClass);
  44.