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

  1. function volcanoClass()
  2. {
  3. }
  4. volcanoClass.prototype = new MovieClip();
  5. volcanoClass.prototype.onLoad = function()
  6. {
  7.    this.startDelay = random(50) + 1;
  8.    this.sDelayCount = 0;
  9.    this.state = "setup";
  10.    this.x = this._x;
  11.    this.y = this._y;
  12.    this.eruptCount = 0;
  13.    this.eruptDelay = random(70) + 50;
  14.    this.gotoAndStop(this.clip.moveType);
  15.    switch(this.clip.moveType)
  16.    {
  17.       case 1:
  18.          break;
  19.       case 2:
  20.          this._rotation = -90;
  21.          break;
  22.       case 3:
  23.          this._rotation = 90;
  24.          break;
  25.       case 4:
  26.          this._rotation = -180;
  27.    }
  28. };
  29. volcanoClass.prototype.onEnterFrame = function()
  30. {
  31.    if(_root.state == "paused")
  32.    {
  33.    }
  34.    if(this.state == "remove")
  35.    {
  36.       removeMovieClip(this);
  37.    }
  38.    if(_root.state == "playing")
  39.    {
  40.       if(this.state == "setup")
  41.       {
  42.          this.sDelayCount = this.sDelayCount + 1;
  43.          if(this.sDelayCount > this.startDelay)
  44.          {
  45.             this.state = "normal";
  46.          }
  47.       }
  48.       if(this.state == "normal")
  49.       {
  50.          this.eruptCount = this.eruptCount + 1;
  51.          if(this.eruptCount > this.eruptDelay)
  52.          {
  53.             this.eruptCount = 0;
  54.             this.clip.attachMovie("volcanoFlame","flame",1);
  55.             flameSnd.start();
  56.          }
  57.       }
  58.    }
  59. };
  60. Object.registerClass("volcano",volcanoClass);
  61.