The Focus Manager handles focus changes caused by mouse clicks. If the user clicks a
component, that component is given focus.
When testing a script using Focus Manager (Control > Test Movie), select Control >
Disable Keyboard Shortcuts in test mode; otherwise, Focus Manager does not appear to
work. Also, tabbing and keyboard shortcuts are used by the authoring environment by
default. So, if you use test mode, the tab navigation, Enter key, and other key
combinations may perform in unexpected ways or appear to fail. Those features should
be tested in the Player outside the authoring environment.
Using Focus Manager
The Focus Manager does not automatically assign focus to a component. You must write a
script that calls
FocusManager.setFocus()
have focus when an application loads.
If you call
FocusManager.setFocus()
loads, the focus ring does not appear around that component. The component has
focus, but the indicator is not present.
To create focus navigation in an application, set the
(including buttons) that should receive focus. When a user presses the Tab key, the Focus
Manager looks for an enabled object with a
value of
. Once the Focus Manager reaches the highest
tabIndex
returns to zero. So, in the following example, the
component) receives focus first, and then the
comment.tabIndex = 1;
okButton.tabIndex = 2;
You can also use the Accessibility panel to assign a tab index value.
If nothing on the Stage has a tab index value, the Focus Manager uses the depth (stacking
order, or z-order). The depth is set up primarily by the order in which components are
dragged to the Stage; however, you can also use the Modify > Arrange > Bring to Front/Send
to Back commands to determine the final depth.
722
FocusManager class
on a component if you want a component to
to set focus to a component when an application
tabIndex
property that is higher than the current
tabIndex
object (probably a TextArea
comment
object receives focus:
okButton
property on any objects
property, it
tabIndex
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers