Focusmanager Class - MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

FocusManager class

You can use the Focus Manager to specify the order in which components receive focus when a
user presses the Tab key to navigate in an application. You can also use the Focus Manager to set a
button in your document that receives keyboard input when a user presses Enter (Windows) or
Return (Macintosh). For example, when users fill out a form, they should be able to tab between
fields and press Enter (Windows) or Return (Macintosh) to submit the form.
All components implement Focus Manager support; you don't need to write code to invoke it.
The Focus Manager interacts with the System Manager, which activates and deactivates
FocusManager instances as pop-up windows are activated or deactivated. Each modal window has
an instance of FocusManager so the components in that window become their own tab set,
preventing the user from tabbing into components in other windows.
The Focus Manager recognizes groups of radio buttons (those with a defined
RadioButton.groupName
property that is set to
selected
see if the next object has the same group name as the current object. If it does, it automatically
moves focus to the next object with a different group name. Other sets of components that
support a
groupName
The Focus Manager handles focus changes caused by mouse clicks. If the user clicks a component,
that component is given focus.
Using the Focus Manager
The Focus Manager does not automatically assign focus to a component. You must write a script
that calls
FocusManager.setFocus()
when an application loads.
Note: If you call
FocusManager.setFocus()
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
buttons) that should receive focus. When a user presses the Tab key, the Focus Manager looks for
an enabled object with a
Once the Focus Manager reaches the highest
following example, the
then the
okButton
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
commands to determine the final depth.
property) and sets focus to the instance in the group that has a
. When the Tab key is pressed, the Focus Manager checks to
true
property can also use this feature.
on a component if you want a component to have focus
to set focus to a component when an application loads,
property that is higher than the current value of
tabIndex
object (probably a TextArea component) receives focus first, and
comment
object receives focus:
Components Dictionary
property on any objects (including
tabIndex
property, it returns to zero. So, in the
tabIndex
CHAPTER 6
tabIndex
FocusManager class
.
419

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

This manual is also suitable for:

Flash mx

Table of Contents