I need to figure out how to capture any keypressed when the flash app has focus. I want to know how does the game developers capture the up, down, left, right, a, s, z, x keys and send them to the flash application. I found the following code, but it is for flash and I am using flex instead of flash and don't have frames to place it. var keyListener:Object = new Object(); keyListener.onKeyDown = function() { trace("DOWN -> Code: "+Key.getCode()+"\tACSII: "+Key.getAscii()+"\tKey: "+chr(Key.getAscii())); }; keyListener.onKeyUp = function() { trace("UP -> Code: "+Key.getCode()+"\tACSII: "+Key.getAscii()+"\tKey: "+chr(Key.getAscii())); }; Key.addListener(keyListener); Code (markup):
Yep, I seen that, but the page doesn't load for me all the way and I don't see the link to the tutorial. Post the link to where the tutorial link leads please. Cause you just posted the tut header not the link to the tut. Oh yeah, this is Adobe FLEX not flash so I can't hook into any KeyFrames of movie clips because Flex doesn't have it. So there isn't any "onClipEvent(enterFrame){"... Flex is based on Flash, but doesn't have the movie clips stuff.