532 Creating Accessible Content
Using ActionScript to create a tab order for
accessible objects
In addition to assigning a tab index to objects with the Accessibility panel (see “Creating a tab
order index for keyboard navigation in the Accessibility panel (Flash Professional only)”
on page 526), you can create the tab order with ActionScript by assigning the
tabIndex
property to the following objects:
■ Dynamic text
■ Input text
■ Buttons
■ Movie clips, including compiled movie clips
■ Timeline frames
■ Screens
If you create a tab order for a frame and you don’t specify a tab order for an accessible object in
the frame, Flash Player ignores all the custom tab order assignments. You should, therefore,
provide a complete tab order for all accessible objects. Additionally, all objects assigned to a
tab order, except frames, must have an instance name specified in the Instance Name text box
of the Property inspector. Even items that are not tab stops, such as text, need to be included
in the tab order if they are to be read in that order.
Because static text cannot be assigned an instance name, it cannot be included in the list of
the
tabIndex property values. As a result, a single instance of static text anywhere in the SWF
file causes the reading order to revert to the default.
To specify a tab order, you assign an order number to the
tabIndex property, as shown in the
following example:
_this.myOption1.btn.tabIndex = 1
_this.myOption2.txt.tabIndex = 2
See tabIndex in the Button, MovieClip, and TextField in the
ActionScript 2.0 Language Reference.
You can also use
tabChildren() or tabEnabled() methods to assign custom tab order. See
MovieClip.tabChildren, MovieClip.tabEnabled, and TextField.tabEnabled in
ActionScript 2.0 Language Reference.