I am using an actionscript 2.0, and i have a movieclips that are are running along the x-axis and given each of them a boundary. And i have also a movieclip for my gamelives. If the three movieclips reaches to its given boundary, the 3lives will turn into 0 and should proceed to the next frame. My problem is, the codes for my gotoandstop doesn't work.
Here is my code for movie clip:
onClipEvent (load) {
speed = 5;
boundary = 280;
}
onClipEvent (enterFrame) {
if (this._x > boundary) {
this._x -= speed;
}
else {
this._x = boundary;
_parent.life -= 1;
_parent.lifebox.text = _parent.life;
this.swapDepths(0);
this.removeMovieClip();
delete this.onEnterFrame;
}
}
Here's my code for my timeline:
stop();
var keyListener:Object = new Object();
var life:Number = 3;
keyListener.onKeyDown = function() {
if (textbox.text == "ant"){
ant_mc.swapDepths(0);
ant_mc.removeMovieClip();
bee_mc._x +=40;
bug_mc._x +=40;
}
if(life == 0){
gotoandstop(1);
}
if (Key.isDown(Key.ENTER)) {
textbox.text="";
}
};
if(life == 0){gotoandstop(1);}
to proceed to the next frame. – nesty santayo