I want to make an rpg and i im having a problem making the movement look like i want it to.
i want when i am holding up for example, for a movieclip to play, but i want it to stop the mc as soon as a let go of up. so far i have 8 directional movement with a mc animation for the (left, right, down and up) movement.....the problem is that even when i let go of up the movie clip continues to play. with a stop it goes to the end, which is not what i want
heres my as code
onClipEvent (load) {
// Set the move speed
moveSpeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x+=moveSpeed;
this.gotoAndStop (2); //frame two of my character is a right movement mc animation
^^that line of code is where i need help ( how do i make is so that when i let go of up the mc on that frame stops imedietly
}else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
this.gotoAndStop (1); //frame one of my character is a left movement mc animation
} if (Key.isDown(Key.DOWN)) {
this._y+=moveSpeed;
this.gotoAndStop (3);
} else if (Key.isDown(Key.UP)) {
this._y-=moveSpeed;
this.gotoAndStop (4);
}
}