Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

numeric keypad for triggering events?

Status
Not open for further replies.

lucybenson

Technical User
Aug 16, 2004
1
AU
Hi.. the problem I'm having is that I can't use the numeric keypad keys (to the right of the alphabet keys - not the numbers along the top) to trigger events.

For example. The number '4' key on the numeric keypad
has a key code of 86, so using this script:

on enterFrame me
--
on keyDown
case (the keyCode) of
86: beep
end case
end
--
end

should make the computer 'beep' when the number '4' on the keypad is pressed. But it doesnt.. Maybe this is an operating system specific thing? I am using mac OSX.
Thanks..
 
That script works for me. There are 3 things that may possibly be causing your problem:

1. Num lock on your keyboard may be off. Num lock must be on for the numpad to work.

2. The stage window may not be selected when you are running the movie. The stage window MUST be selected or the keyDown even will not get called.

3. The script may not be in the right place. If you want it to apply to the whole movie, it needs to be a movie script. If it's a behavior script, it must be attached to a sprite or else it won't run.

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top