Flash CS3  |  Go to CS4 Help

Implementing screen reader detection with the Accessibility.isActive() method

To create Flash content that behaves in a specific way if a screen reader is active, use the Accessibility.isActive() ActionScript method, which returns a value of true if a screen reader is present, and false otherwise. You can then design your Flash content to perform so that it’s compatible with screen reader use (for example, by hiding child elements from the screen reader). For more information, see isActive (Accessibility.isActive method) in ActionScript 2.0 Language Reference.

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.

Comments

Comments are no longer accepted for Flash CS3. Flash CS4 is the current version. To discuss Flash CS3, please use the Adobe forum.