I use this when I need to get key codes, letters etc...
ActionScript Code:
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
trace("DOWN -> Code:");
trace("\tCode: "+Key.getCode());
trace("\tACSII: "+Key.getAscii());
trace("\tKey: "+chr(Key.getAscii()));
myTxt.text = ("\tCode: "+Key.getCode()+"\tACSII: "+Key.getAscii()+"\tKey: "+chr(Key.getAscii()));
};
Key.addListener(keyListener);
Also here are some great posts by inhan and xxneon for using
if/else and switch/case with the key class and would be perfect for you.
http://www.actionscript.org/forums/s....php3?t=159333
Also here is a good link from Adobe:
Keyboard keys and key code values overview
http://livedocs.adobe.com/flash/mx20...=00001113.html
So you can use the code provided above, then use the codes in those links to create your events when specific keys are pressed.
Atleast I hope it helps. ;-)