Disabling key presses

I was wondering if anyone can help - I am creating a dancing game:

http://www.handsomeboymodelingschool.co.uk/games/dancingjoe/

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.

is this possible?

If you post the code/fla, I can help you out.

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:

dancing = false;

Hope this helps you :hugegrin:

Cyberathlete, I think you made a typo (Then again, it could be my rookie comprehension). At the end of every animation, it should say

_root.isDancing = false;

if u post the FLA i can help you out.

this was a great help, exactly what i was after.

cheers :slight_smile: