Making Components Accessible; Improving Component Usability - MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

Making components accessible

A growing requirement for web content is that it should be accessible to people who have
disabilities. Visually impaired people can use the visual content in Flash applications by means of
screen reader software, which provides an audio description of the material on the screen.
When you create a component, you can include ActionScript that enables the component and a
screen reader to communicate. Then, when developers use your component to build an
application in Flash, they use the Accessibility panel to configure each component instance.
Flash MX 2004 includes the following accessibility features:
Custom focus navigation
Custom keyboard shortcuts
Screen-based documents and the screen authoring environment
An Accessibility class
To enable accessibility in your component, add the following line to your component's class file:
mx.accessibility.ComponentName.enableAccessibility();
For example, the following line enables accessibility for the MyButton component:
mx.accessibility.MyButton.enableAccessibility();
When developers add the MyButton component to an application, they can use the Accessibility
panel to make it available to screen readers.

Improving component usability

After you create the component and prepare it for packaging, you can make it easier for your users
to use. This section describes some techniques for adding usability to your component.
Adding an icon
You can add an icon that represents your component in the Components panel of the Flash
authoring environment.
To add an icon for your component:
Create an image with the following specifications:
1.
18 pixels x 18 pixels
Saved in PNG format
8-bit with alpha transparency
A transparent upper-left pixel, to support masking
Add the following definition to your component's ActionScript class file before the class
2.
definition:
[IconFile("component_name.png")]
Add the image to the same directory as the FLA file.
3.
When you export the SWC file, Flash includes the image at the root level of the archive.

Improving component usability

71

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents