You can use the Selection ActionScript object to get and set the current keypad focus, or to benotified when an object receives or loses keypad focus. This is useful, for example, if you want to automatically set the focus to a specific button when your application first loads. Or you may want to be notified when a specific object on the screen has received (or lost) keypad focus so that you can update the screen accordingly.
For example, the following code uses the Selection.setFocus() method to set focus to the button instance named login_btn:Selection.setFocus(login_btn);
The Selection.onSetFocus event listener lets you determine when the keypad focus has changed. You can use this event listener, for example, to create a custom focus manager for input text fields, rather than use the default focus rectangle. The following procedure shows how to create a custom focus manager that changes the border color of the TextField object with focus. A completed version of this application named custom_input_focus.fla is located in the /Sample and Tutorials/Samples/Flash Lite 2.0/ folder in the Flash Professional 8 installation folder on your computer.
Read more … »


