Packagemx.accessibility
Classpublic class AccImpl
InheritanceAccImpl Inheritance AccessibilityImplementation
SubclassesAccordionHeaderAccImpl, ButtonAccImpl, ComboBaseAccImpl, DateChooserAccImpl, DateFieldAccImpl, ListBaseAccImpl, MenuBarAccImpl, PanelAccImpl, SliderAccImpl, TabBarAccImpl, TreeAccImpl

Review Needed

The AccImpl class, also called the Accessibility Implementation class, is the base class for the implementation of accessibility in components. This class enables communication between a component and a screen reader. Screen readers are used to translate screen content into synthesized speech or braille for visually impaired users.

AccImpl inherits from flash.accessibility.AccessibilityImplementation. Accessibility implementations for Flex components should inherit AccImpl.

AccImpl supports system roles, object based events, and states.

AccImpl reports the following state by default to a screen reader:

AccImpl dispatches the following event to a screen reader:

See also

flash.accessibility.AccessibilityImplementation
flash.accessibility.AccessibilityProperties


Public Properties
 PropertyDefined by
 Inheritederrno : uint
Errors are indicated out-of-band, rather than in return values.
AccessibilityImplementation
 Inheritedstub : Boolean
If a component is released without an ActionScript accessibility implementation, it is strongly suggested that a component accessibility stub be included.
AccessibilityImplementation
Protected Properties
 PropertyDefined by
  eventsToHandle : Array
[read-only] All AccImpl subclasses must override this function by returning an array of strings of the events for which the class should listen from its master component.
AccImpl
  master : UIComponent
A reference to the UIComponent instance that this AccImpl instance is making accessible.
AccImpl
  role : uint
Accessibility Role of the component being made accessible.
AccImpl
Public Methods
 MethodDefined by
  
Creates a new Accessibility Implementation instance for the specified component.
AccImpl
 Inherited
accDoDefaultAction(childID:uint):void
IAccessible method that performs the default action associated with the component that this AccessibilityImplementation represents or of one of its child elements.
AccessibilityImplementation
 Inherited
accLocation(childID:uint):*
IAccessible method for returning a DisplayObject or Rectangle specifying the bounding box of a child element in the AccessibilityImplementation.
AccessibilityImplementation
 Inherited
accSelect(selFlag:uint, childID:uint):void
IAccessible method for altering the selection in the component that this AccessibilityImplementation represents.
AccessibilityImplementation
  
[static] Method call for enabling accessibility for a component.
AccImpl
 Inherited
get_accDefaultAction(childID:uint):String
IAccessible method for returning the default action of the component that this AccessibilityImplementation represents or of one of its child elements.
AccessibilityImplementation
 Inherited
get_accFocus():uint
IAccessible method for returning the unsigned integer ID of the child element, if any, that has child focus within the component.
AccessibilityImplementation
  
get_accName(childID:uint):String
IAccessible method for returning the name for the component that this AccessibilityImplementation represents or for one of its child elements.
AccImpl
  
get_accRole(childID:uint):uint
IAccessible method for returning the system role for the component that this AccessibilityImplementation represents or for one of its child elements.
AccImpl
 Inherited
IAccessible method for returning an array containing the IDs of all child elements that are selected.
AccessibilityImplementation
 Inherited
get_accState(childID:uint):uint
IAccessible method for returning the current runtime state of the component that this AccessibilityImplementation represents or of one of its child elements.
AccessibilityImplementation
 Inherited
get_accValue(childID:uint):String
IAccessible method for returning the runtime value of the component that this AccessibilityImplementation represents or of one of its child elements.
AccessibilityImplementation
 Inherited
Returns an array containing the unsigned integer IDs of all child elements in the AccessibilityImplementation.
AccessibilityImplementation
Protected Methods
 MethodDefined by
  
eventHandler(event:Event):void
Handles events from the master component.
AccImpl
  
getName(childID:uint):String
Returns the name of the accessible component or the name of one of its child elements.
AccImpl
  
getState(childID:uint):uint
Returns the state of the accessible component.
AccImpl
Property detail
eventsToHandleproperty
eventsToHandle:Array  [read-only]

All AccImpl subclasses must override this function by returning an array of strings of the events for which the class should listen from its master component.

Implementation
    protected function get eventsToHandle():Array
masterproperty 
protected var master:UIComponent

A reference to the UIComponent instance that this AccImpl instance is making accessible.

roleproperty 
protected var role:uint

Accessibility Role of the component being made accessible.

See also

Constructor detail
AccImpl()constructor
public function AccImpl(master:UIComponent)

Creates a new Accessibility Implementation instance for the specified component.

Direct calls to the AccImpl constructors are unneccessary. When a Flex project is compiled with Generate accessible SWF file set to true, the compiler instantiates the accessibility implementations for the components used in the project that have them by calling the the static enableAccessibility() method.

Parameters
master:UIComponent — The UIComponent instance that this AccImpl instance is making accessible.

See also

Method detail
enableAccessibility()method
public static function enableAccessibility():void

Method call for enabling accessibility for a component. This method is required for the compiler to activate the accessibility classes for a component.

When a Flex project is compiled with the Generate accessible SWF file set to true, the Flex compiler automatically enables accessibility implementations for the components used in the project that have them.

Accessible component classes should include the [AccessibilityClass] meta tag to specify the appropriate AccImpl subclass or accessibility implementation and let the compiler know to call enableAccessibility().

See also


Example
Following is an example showing how the [AccessibilityClass] meta tag specifies the appropriate AccImpl subclass or accessibility implementation for the mx.controls.Button component.
[AccessibilityClass(implementation="mx.accessibility.ButtonAccImpl")]

eventHandler()method 
protected function eventHandler(event:Event):void

Handles events from the master component. All AccImpl subclasses must implement this method to listen for events from their master components.

Parameters
event:Event — The event object.
get_accName()method 
public override function get_accName(childID:uint):String

IAccessible method for returning the name for the component that this AccessibilityImplementation represents or for one of its child elements.

In the case of the AccessibilityImplementation itself (childID == 0), if this method is not implemented, or does not return a value, the Flash Player will fall back to the AccessibilityProperties.name property, if it is present.

For AccessibilityImplementations that can have child elements, this method must be implemented, and must return a string value when childID is nonzero.

Depending on the type of user interface element, names in MSAA mean one of two different things: an author-assigned name, or the actual text content of the element. Usually, an AccessibilityImplementation itself will fall into the former category—its name property is an author-assigned name. Child elements always fall into the second category—their names indicate their text content.

When the name property of an AccessibilityImplementation has the meaning of an author-assigned name, there are two ways in which components can acquire names from authors. The first entails names present within the component itself; for example, a checkbox component might include a text label that serves as its name. The second—a fallback from the first—entails names specified in the UI, and ending up in AccessibilityProperties.name. This fallback option allows users to specify names just as they would for any other Sprite or MovieClip.

This leaves three possibilities for the AccessibilityImplementation itself (childID == zero):

Note that for child elements(if the AccessibilityImplementation can have them), the third case always applies. The get_accName method should be implemented and should return an appropriate string value when childID is nonzero.

Parameters
childID:uint — An unsigned integer corresponding to one of the component's child elements as defined by getChildIDArray().

Returns
String — Name of the component or one of its child elements.

See also

get_accRole()method 
public override function get_accRole(childID:uint):uint

IAccessible method for returning the system role for the component that this AccessibilityImplementation represents or for one of its child elements. System roles are predefined for all the components in MSAA.

Parameters
childID:uint — An unsigned integer corresponding to one of the component's child elements as defined by getChildIDArray().

Returns
uint — System role associated with the component.

See also

getName()method 
protected function getName(childID:uint):String

Returns the name of the accessible component or the name of one of its child elements.

All AccImpl subclasses must implement this method instead of implementing get_accName.

Parameters
childID:uint — An unsigned integer corresponding to one of the component's child elements as defined by getChildIDArray().

Returns
String — The name of the accessible component.

See also

getState()method 
protected function getState(childID:uint):uint

Returns the state of the accessible component.

Parameters
childID:uint — An unsigned integer corresponding to one of the component's child elements as defined by getChildIDArray().

Returns
uint — A combination of zero, one, or more of the system state constants. Multiple constants are assembled into a bitfield using |, the bitwise OR operator.

See also