Skip to main content
Participating Frequently
November 20, 2008
Question

Keyboard Event problems

  • November 20, 2008
  • 5 replies
  • 483 views
I keep getting an error from the Keyboard.NUMBER_2. If I use NUMPAD_2 it works fine, but I don't want to use the numpad if I don't have to.
Also, the keyboard events do the same thing in every frame - how can I get them to do different things for different frames?
This topic has been closed for replies.

5 replies

kglad
Community Expert
Community Expert
November 20, 2008
you're welcome.
jwlaginaAuthor
Participating Frequently
November 20, 2008
thanks! that works great.
kglad
Community Expert
Community Expert
November 20, 2008
:

if (event.keyCode == 50)
{
gotoAndStop (7);
}
jwlaginaAuthor
Participating Frequently
November 20, 2008
Do I just replace the 2 with 50 or do I need to change NUMBER to something else? Just changing 2 to 50 doesn't seem to work for me.
kglad
Community Expert
Community Expert
November 20, 2008
use 50 if you want the number 2 and don't want to use the keypad number 2.

use a different listeners if you want the keys to prompt different actions at different times.