This content has been marked as final.
Show 3 replies
-
1. Re: Flash Key Pressed Function
Ned Murphy Jan 2, 2010 6:35 AM (in response to d0brin)Key codes generally are grouped into sets, starting at one value thru another. So you can use a set of conditionals to test if the key code is within the range of the letter keys. Here's a link to a chart showing the key codes for Flash...
http://people.uncw.edu/tompkinsj/112/FlashActionScript/keyCodes.htm
Here is an example in AS2. Be sure to disable keyboard shortcuts in the player when testing locally.
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
var keyPressed= Key.getCode();
if (keyPressed > 64 && keyPressed < 91) {
trace("You're pressing a letter key");
}
};
Key.addListener(keyListener); -
-
3. Re: Flash Key Pressed Function
Ned Murphy Jan 3, 2010 12:10 PM (in response to d0brin)You're welcome



