Hi, I am trying to build a keyboard handler for a game using Flex.  I'm getting confused and I'm hoping I can find some guidance here.

I have been trying to build a global keyboard listener that grabs any keystroke in the flash movie.  The keyboard should move the games character around on screen regardless of what flex button has recently been clicked or what textfield has focus.  My stumbling block is that when I attach an event listener to the main MXML application tag, it only recieves keyboard events when a button, textfield, or other flex component is selected(has focus).  The main flex application window does not send keyboard events, only components do.   I would like to know how to capture keyboard events when nothing in the application is selected?

I can guess at 2 ways of doing this:
1. I think could build the app so it has a textfield that is given focus when nothing else is selected, and capture all keystrokes here.
2. I may be able to find a way of making the main application window dispatch keyboard events..?

An example of a Flex application that handles keyboard events would be a great help. 

Thanks for any thoughts,
Drew

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to