home *** CD-ROM | disk | FTP | other *** search
- function volcanoClass()
- {
- }
- volcanoClass.prototype = new MovieClip();
- volcanoClass.prototype.onLoad = function()
- {
- this.startDelay = random(50) + 1;
- this.sDelayCount = 0;
- this.state = "setup";
- this.x = this._x;
- this.y = this._y;
- this.eruptCount = 0;
- this.eruptDelay = random(70) + 50;
- this.gotoAndStop(this.clip.moveType);
- switch(this.clip.moveType)
- {
- case 1:
- break;
- case 2:
- this._rotation = -90;
- break;
- case 3:
- this._rotation = 90;
- break;
- case 4:
- this._rotation = -180;
- }
- };
- volcanoClass.prototype.onEnterFrame = function()
- {
- if(_root.state == "paused")
- {
- }
- if(this.state == "remove")
- {
- removeMovieClip(this);
- }
- if(_root.state == "playing")
- {
- if(this.state == "setup")
- {
- this.sDelayCount = this.sDelayCount + 1;
- if(this.sDelayCount > this.startDelay)
- {
- this.state = "normal";
- }
- }
- if(this.state == "normal")
- {
- this.eruptCount = this.eruptCount + 1;
- if(this.eruptCount > this.eruptDelay)
- {
- this.eruptCount = 0;
- this.clip.attachMovie("volcanoFlame","flame",1);
- flameSnd.start();
- }
- }
- }
- };
- Object.registerClass("volcano",volcanoClass);
-