I need to disable the keyboard after each key is pressed, so if the user presses the UP key untill the character has finihsed doing the move no other key can be pressed.
when the user presses a key, for example: UP, set a variable saying that the guy is dancing, and whenever the user presses any key, it runs a test to see if the guy is dancing, and if he is, then it won’t do anything, if he isn’t, then it’ll make him dance. only once the dancing animation has comleted will the variable be set to equal ‘the guy not dancing’, for example, we might have this:
in the joe movieclip:
onClipEvent(enterFrame) {
if (Key.isDown(Key.UP)) {
if(isDancing != true) {
isDancing = true;
//code to make joe dance;
}
}
if (Key.isDown(Key.DOWN)) {
if(isDancing != true) {
isDancing = true;
//code to make joe dance differently;
}
}
also, at the end of every animation of joe dancing, we must use: