![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
To create focus navigation in an application, set the tabIndex
property on any objects (including buttons) that should receive focus. When a user presses the Tab key, the FocusManager looks for an enabled object with a tabIndex
property that is higher than the current value of tabIndex
. Once the FocusManager reaches the highest tabIndex
property, it returns to zero. So, in the following example, 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;
Note: The FocusManager is sensitive to when objects are placed on the Stage (the depth order of objects) and not their relative positions on the stage. This is different from the way Flash Player handles tabbing.
There are no authoring parameters for the FocusManager. You must use the ActionScript methods and properties of the FocusManager class in the Actions panel. For more information, see FocusManager class.
The following procedure creates a focus scheme in a Flash application.
comment.tabIndex = 1; okButton.tabIndex = 2; focusManager.setFocus(comment); focusManager.defaultPushButton = okButton; lo = new Object(); lo.click = function(){ trace("button was clicked"); } okButton.addEventListener("click", lo);
This code sets the tab ordering and specifies a default button to receive a click
event when a user presses Enter (Windows) or Return (Macintosh).
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |