The following are guidelines and considerations for using default navigation in your Flash Lite applications.
- If you disable the default focus rectangle by setting _focusRect to false, be sure to provide an alternative focus indicator for your buttons, input text fields, and tab-enabled movie clips. For buttons, you can do this by adding a visual element to the button's "over" state--the part of a button object's timeline that's displayed when the button has focus. For an example of this technique, see the sample application in Create a simple menu using buttons and default navigation. For input text fields, you can use the Selection object to determine when the text field has received focus and display the desired focus indicator. For an example, see the sample application discussed in Controlling focus with ActionScript.
- Have at least two objects (input text fields, buttons, tab-enabled movie clips, or a combination) on the screen at the same time. If the screen contains only one input text field, button, or tab-enabled movie clip, the user can't change the focus and may feel stuck in the user interface.
If a screen in your application contains only a single button for user interaction, consider detecting a keypress event rather than using button events. For more information, see About key and button events.
- When appropriate, consider using the Selection.setFocus() method to set the initial focus to a specific object on the screen. This can help guide the user through the interface and reduce the amount of key navigation they must perform. For example, suppose that a screen in your application contains an input text field. Normally, for the user to enter a value in the text field, they would first press a navigation key to give the text field focus, and then press the select key to open the text input dialog box. You could use the following ActionScript to automatically set the keypad focus to the input text field:
Selection.setFocus(inputTxt);
For more information about controlling focus with ActionScript, see Controlling focus with ActionScript.
- The alignment of objects on the screen is important with default navigation. When objects are offset from each other on the screen, the sequence in which they get focus may not be intuitive for your users. You can prevent this by making objects consistent in size and aligning them vertically and horizontally as much as possible. With two-way navigation, you can also control the sequence using the tabIndex property; for more information, see Controlling tab order in two-way navigation.