Adobe Flash Professional CS3 User Manual

Page 371

Advertising
background image

FLASH CS3

User Guide

365

For example, you could use the

Accessibility.isActive()

method to decide whether to include unsolicited

animation. Unsolicited animation happens without the screen reader doing anything, which can be confusing for
screen readers.

The

Accessibility.isActive()

method provides asynchronous communication between the Flash content and

Flash Player; a slight real-time delay can occur between the time the method is called and the time when Flash Player
becomes active, returning an incorrect value of

false

. To ensure that the method is called correctly, do one of the

following:

Instead of using the

Accessibility.isActive()

method when the Flash content first plays, call the method

whenever you need to make a decision about accessibility.

Introduce a short delay of one or two seconds at the beginning of your document to give the Flash content enough
time to contact Flash Player.

For example, you can use an

onFocus

event to attach this method to a button. This approach generally gives the SWF

file enough time to load and you can assume a screen reader user will tab to the first button or object on the Stage.

Use ActionScript to create a tab order for accessible objects

To create the tab order with ActionScript code, assign the

tabIndex

property to the following objects:

Dynamic text

Input text

Buttons

Movie clips, including compiled movie clips

Timeline frames

Screens

Provide a complete tab order for all accessible objects. 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.
Additionally, all objects assigned to a tab order, except frames, must have an instance name specified in the Instance
Name text field 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, assign an order number to the

tabIndex

property, as the following example shows:

_this.myOption1.btn.tabIndex = 1

_this.myOption2.txt.tabIndex = 2

See

tabIndex

in

Button

,

MovieClip

, and

TextField

in the ActionScript 2.0 Language Reference.

You can also use the

tabChildren()

or

tabEnabled()

methods to assign custom tab order. See

MovieClip.tabChildren

,

MovieClip.tabEnabled

, and

TextField.tabEnabled

in the ActionScript 2.0

Language Reference.

See also

“Create a tab-order index for keyboard navigation in the Accessibility panel” on page 360

Advertising