Creating custom focus navigation

When a user presses the Tab key to navigate in a Flash application or clicks in an application, the FocusManager class determines which component receives focus. You don't need to add a FocusManager instance to an application or write any code to activate the FocusManager.

If a RadioButton object receives focus, the FocusManager examines that object and all objects with the same groupName value and sets focus on the object with the selected property set to true.

Each modal Window component contains an instance of the FocusManager so the controls on that window become their own tab set, which prevents a user from inadvertently getting into components in other windows by pressing the Tab key.

To create focus navigation in an application, set the tabIndex property on any components (including buttons) that should receive focus. When a user presses the Tab key, the FocusManager class looks for an enabled object with a tabIndex property that is higher than the current value of tabIndex. Once the FocusManager class reaches the highest tabIndex property, it returns to zero. For example, in the following, the comment object (probably a TextArea component) receives focus first, and then the okButton object receives focus:

comment.tabIndex = 1;
okButton.tabIndex = 2;

To create a button that receives focus when a user presses Enter (Windows) or Return (Macintosh), set the FocusManager.defaultPushButton property to the instance name of the desired button, as in the following:

FocusManager.defaultPushButton = okButton;

The FocusManager class overrides the default Flash Player focus rectangle and draws a custom focus rectangle with rounded corners.