# Setting the name property for a non-text object

ID: FLASH1

Technology: flash

Type: Technique

## When to Use

- Adobe Flash Professional version MX and higher
- Adobe Flex

## Description

The objective of this technique is to show how non-text objects in Flash can be marked so that they can be read by assistive technology.

The Flash Player supports text alternatives to non-text objects using the `name` property in the accessibility object, which can be defined in ActionScript or within Flash authoring tools.

When an object contains words that are important to understanding the content, the `name` property should include those words. This will allow the `name` property to play the same function on the page as the object. Note that it does not necessarily describe the visual characteristics of the object itself but must convey the same meaning as the object.

## Examples

### Applying a textual alternative for a symbol (graphic, button or movieclip)

The Flash Professional authoring tool's Accessibility panel lets authors provide accessibility information to assistive technology and set accessibility options for individual Flash objects or entire Flash applications.

1. For a text alternative to be applied to a non-text object, it must be saved as a symbol in the movie's library. Note: Flash does not support text alternatives for graphic symbols. Instead, the graphic must be converted to or stored in a movie clip or button symbol.
2. Bring up the Accessibility panel by selecting "Window > Other Panels > Accessibility" in the application menu, or through the shortcut ALT + F11. Ensure that the 'Make object accessible' checkbox is checked.
3. Select the non-text instance on the movie stage, the fields in the Accessibility panel become editable.
4. Enter a meaningful text alternative in the 'name' field, properly describing the purpose of the symbol.

The Accessibility panel in the Flash authoring environment.

### Applying textual alternatives programmatically in ActionScript 2.0

To manage an object's text equivalent programmatically using ActionScript 2, the _accProps object must be used. This references an object containing accessibility related properties set for the object. The code example below shows a simple example of how the _accProps object is used to set an objects name in ActionScript.

    // 'print_btn' is an instance placed on the movie's main timeline
    _root.print_btn._accProps = new Object();
    _root.print_btn._accProps.name = "Print";

### Applying textual alternatives programmatically in ActionScript 3.0

To manage an object's text equivalents programmatically using ActionScript 3, the `AccessibilityProperties` object and `name` property must be used. The code example below shows a simple example of how the `name` property is used to set an objects name in ActionScript.

    // 'print_btn' is an instance placed on the movie's main timeline
    print_btn.accessibilityProperties = new AccessibilityProperties();
    print_btn.accessibilityProperties.name = "Print";

## Tests

### Procedure

1. Publish the SWF file
2. Open the SWF file in Internet Explorer 6 or higher (using Flash Player 6 or higher), or Firefox 3 or higher (using Flash Player 9 or higher)
3. Use a tool which is capable of showing an object's name text alternative, such as ACTF aDesigner 1.0 to open the Flash movie.
4. In the GUI summary panel, loop over each object which is contained by the Flash movie and ensure the object that was provided a name has a proper name attribute appearing in the tool's display.
5. Authors may also test with a screen reader, by reading the Flash content and listening to hear that the equivalent text is read when tabbing to the non-text object (if it is tabbable) or hearing the alternative text read when reading the content line-by-line.
6. All non-text objects have text equivalents that can serve the same purpose and convey the same information as the non-text object

### Expected Results

Check #6 is true.

## Related Techniques

- G94