Hey there. Im wondering if anyone here can help me out with my code. The code works fine other than the fact that i have to hold the SPACE key down in order to play my animation frames. What method would i use to make it so when i PRESS the SPACE key my "strike" animation frames play.
here's my code so far.
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE)) {
if (touchingGround == true) {
this.gotoAndStop("strike");
}else if (Key.isDown(Key.RIGHT)) {
_xscale = +scale;
if (touchingGround == true) {
this.gotoAndStop("walk");
}
_x += speed;
} else if (Key.isDown(Key.LEFT)) {
_xscale = -scale;
if (touchingGround == true) {
this.gotoAndStop("walk");
}
_x -= speed;
} else {
if (touchingGround == true) {
this.gotoAndStop("idle");
}
}
thanks in advance. sorry im a noob to actionscript.