hello
please can someone help me with my movement code, ive got my character in an mc, and in that mc are four mc's on different frames. prone, jump, left and right. My code below is what ive got so far, i want it so when you move it goes to that frame but when you let go off that key it stops playing that frame and goes to frame one. And then if your jumping you cant press left or right until you go back to the ground. Thanks a lot for your help..
onClipEvent (load) {
sspeed = 4;
jumping = false;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_x += sspeed;
this.gotoAndStop(4);
}
if (Key.isDown(Key.DOWN)) {
this.gotoAndStop(1);
}
if (Key.isDown(Key.LEFT)) {
_x -= sspeed;
this.gotoAndStop(3);
}
if (Key.isDown(Key.UP) && this._currentframe == 1 && jumping == false) {
this.gotoAndStop(2);
}
}
Thanks!