Your specific development situation will determine which of the preceding methods is used. It is acceptable to provide end users with double links to the same application: one with accessibility enabled, another without. Developers may also implement a check for an assistive technology device on the client system and redirect the user to an accessible version as needed.
Using accessible components
Flex 4 includes 35 accessible controls. Each component has been thoroughly reviewed and tested for accessibility and interoperability with assistive technology. In order for a RIA created with Flex 4 to be accessible, it must use accessible components.
For a component to be accessible, it must expose role and state information according to the Microsoft Active Accessibility (MSAA) specification. Developers planning to develop their own components should plan to research and implement MSAA from the beginning to help ensure the consistent behavior of Flex components with other controls at the operating system level. Once MSAA support has been added to a control, it is important to validate that the component works with assistive technology, such as the JAWS screen reader. Screen readers rarely implement the entire MSAA spec, particularly inside of the browser, as web applications typically rely only on the 12 base controls that are included in the HTML specification. Some degree of coordination with screen reader vendors may be required if a custom-built component deviates from the approach used in the default Flex component set or a new control type is introduced.
The default set of components was developed with the intention of accelerating application development. The requirements for creating accessible custom components are nontrivial due to the complex nature of MSAA and screen reader interoperability. For this reason, developers are strongly encouraged to leverage the default Flex components whenever possible.
Controlling reading order
Reading order describes the order in which a screen reader reads the content on the screen. The default reading order of a SWF file does not follow a predictable left-to-right, top-to-bottom order. For simple Flex applications, reading order may not be an issue; however, complex Flex applications may be difficult to understand unless the reading order is controlled. The following example consists of a tree control, data grid, and text area. For this application, the screen reader reads the contents of the tree control, the data grid, and then the text area. In this case, the developer should read the content using a screen reader to help ensure that the order is not confusing to the end user. The screen reader would read the title, followed by the tree control, the data grid, the text box, and the links below. Since this is roughly how one would follow the application visually, no additional attention needs to be paid to the reading order.
Figure 1. Screen shot of Flex application with three components
The second example presents a slightly more complex application. In this case, it is possible that labels associated with specific controls will not be read at the same time as the control itself. Thus users may believe that they should enter the ZIP code in a field, when in fact, they should enter their telephone number. In applications such as this one, the developer should take steps to control the reading order.
The easiest method to control the reading order is to keep the user interface relatively simple. Efficient use of the accordion or tab navigator can help guide users through an application easily. At the same time, these components help control the reading order of an application to accommodate screen reader users.
Applications with more complex layouts are more likely to create issues for screen reader users. Figure 2 provides a common example of an application that will create problems for screen reader users. The application uses a repeater to populate a grid. There are four rows of products, and each product has an image and a label. Since the labels and images are in separate components, they may not necessarily be read one after the other in a predictable order because of the relatively simplistic way in which Adobe Flash® Player computes the tab order. As a result, this application will likely require that reading order be controlled.
Figure 2. Screen shot of a Flex application containing four rows of images and labels in a VBox container that may require a developer to control reading order.
In this case, a second method for controlling reading order is needed: Assign values to the tabIndex attribute within the MXML file. This method allows the designer to precisely control reading order. In a SWF file, there is no distinction between reading order and tab order. Contents are read by a screen reader in the order specified by the list of tabIndex values, so it is important to add tabIndex values for all objects, including all text fields and other nonfocusable interface controls.
In this smaller version of the example above, you specify the tabIndex values using the following code. You must specify the tabIndex values for all objects within the application — missing a single object causes the reading order to revert to the default.