FLASH25: Labeling a form control by setting its accessible name

Important Information about Techniques

See Understanding Techniques for WCAG Success Criteria for important information about the usage of these informative techniques and how they relate to the normative WCAG 2.0 success criteria. The Applicability section explains the scope of the technique, and the presence of techniques for a specific technology does not imply that the technology can be used in all situations to create content that meets WCAG 2.0.

User Agent and Assistive Technology Support Notes

Description

The objective of this technique is to provide an accessible name to
the built in form components provided by Flash. Some components, such
as radio buttons, checkboxes and buttons, have their own label property.
For other components, the developer needs to specify the component's
label text as accessible name. This can be either be achieved through
the Accessibility panel (for components placed on the stage during
authoring) or through scripting (for components that are dynamically
created at runtime).

ActionScript 2

In ActionScript 2 the accessible name needs to be set on a component's
_accProps property. This property must be an object. If the property
has not been set yet, the developer needs to create a custom object
and assign it to the _accProps property. The object itself can have
several accessibility related properties, one of them being _accProps.name,
which specifies the accessible name. When an _accProps property is
updated, the developer must call Accessibility.UpdateProperties() for
the changes to take effect. Before calling Accessibility.UpdateProperties(),
it is recommended to check the System.capabilities.hasAccessibility
flag. this will prevent an error on environments that do not support
MSAA.

ActionScript 2 provides the following accessible components:

SimpleButton

CheckBox

RadioButton

Label

TextInput

TextArea

ComboBox

ListBox

Window

Alert

DataGrid

ActionScript 3

In ActionScript 3 the accessible name needs to be set on a component's
accessibilityProperties property. This property must be an an instance
of flash.accessibility.AccessibilityProperties. If the property has
not been set yet, the developer needs to create the a new AccessibilityProperties
instance and assign it to the accessibilityProperties property. The
object itself can have several accessibility related properties, one
of them being accessibilityProperties.name which specifies the accessible
name. When an accessibilityProperties property is updated, the developer
must call flash.accessibility.Accessibility.UpdateProperties() for the
changes to take effect. Before calling Accessibility.UpdateProperties(),
it is recommended to check the flash.system.capabilities.hasAccessibility
flag. this will prevent an error on environments that do not support
MSAA.

ActionScript 3 provides the following accessible components.

Button

CheckBox

ComboBox

List

RadioButton

TileList

Examples

Example 1: Setting a component's accessible name using the Accessibility panel

To add and label a component control, follow these steps:

From the 'Components' panel, drag the component on to the stage,
or use scripting to create a new instance.

With the newly created component instance selected, enter its
label text in the Accessibility Panel's Name field.

Example 2: Setting the accessible name through ActionScript 2.0

The code example below shows how a ListBox component is created and assigned an accessible name.

Tests

Procedure

The selected component's label text is specified in the Accessibility
Panel's "name" field.

In ActionScript 2.0: Scripting is used to dynamically set the
component's _accProps.name property

In ActionScript 3.0: Scripting is used to dynamically set the
component's accessibilityProperties.name property

Expected Results

One of the above is true

If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance.