Flash CS3 Documentation |
|||
| Developing Flash Lite 1.x Applications > Creating Interactivity and Navigation > Using tab navigation in Flash Lite > About the focus rectangle | |||
By default, Flash Lite draws a yellow rectangle around the button or input text field that has focus. The focus rectangle lets the user know which object on the screen will respond when the user presses the device's Select key. For example, the following image shows the focus rectangle drawn around a button that has the current keypad focus:
For buttons, the focus rectangle's bounding box is determined by the button's hit area--the invisible region that (in Flash desktop applications) defines the part of the button that responds to mouse clicks. For input text fields, the focus rectangle's bounding box is determined by the text field's dimensions.
You can disable the default focus rectangle behavior by setting the _focusrect property to false. If you're using buttons that define over states, Flash Lite displays those states when the button receives focus. For this reason, the focus rectangle is often not necessary when using buttons. For example, the following image shows the same application as in the preceding image, but with the focus rectangle disabled; the button that has focus is displaying its over state: <updated Mar. 20, 2008: corrected capitalization of _focusrect property>
If your application contains input text fields, Adobe recommends that you do not disable the focus rectangle, as it provides the only visual clue that an input text field has focus. For example, the following image shows an input text field that has the current focus:
If your application contains buttons (with defined over states) and input text fields on the same screen, you can set the _focusrect property to false in each button's on(rollOver) event handler and set it to true in each button's on(rollOut) handler, as shown in the following code example. This causes the focus rectangle to appear when an input text field has focus, but not when a button has focus. <updated Mar. 20, 2008: corrected capitalization of _focusrect property>
// Attach this code to each button on the Stage.
on(rollOver) {
_focusrect = false;
}
on(rollOut) {
_focusrect = true;
}
For more information about using input text fields, see Using input text fields.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00005644.html