spark.accessibility

# ToggleButtonAccImpl - AS3 Flex

Package | spark.accessibility
Class | public class ToggleButtonAccImpl
Inheritance | ToggleButtonAccImpl ButtonBaseAccImpl AccImpl AccessibilityImplementation Object

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

ToggleButtonAccImpl is the accessibility implementation class for spark.components.ToggleButton.

When a Spark ToggleButton is created, its `accessibilityImplementation` property is set to an instance of this class. The Flash Player then uses this class to allow MSAA clients such as screen readers to see and manipulate the ToggleButton. See the mx.accessibility.AccImpl and flash.accessibility.AccessibilityImplementation classes for background information about accessibility implementation classes and MSAA.

Children

A ToggleButton has no MSAA children.

Role

The MSAA Role of a ToggleButton is ROLE_SYSTEM_PUSHBUTTON.

Name

The MSAA Name of a ToggleButton is, by default, the label that it displays. When wrapped in a FormItem element, this label will be combined with the FormItem's label. To override this behavior, set the ToggleButton's `accessibilityName` property.

To provide two separate names for the different states of an icon-based ToggleButton (such as "Mute" and "Unmute", or "Play" and "Pause"), both names can be separated by a comma in the `accessibilityName` property, as in `accessibilityProperty="Mute,Unmute"`. When using state specific names like this the button will not exposed the "pressed" state when pressed.

When the Name changes, a ToggleButton dispatches the MSAA event EVENT_OBJECT_NAMECHANGE.

Description

The MSAA Description of a ToggleButton is, by default, the empty string, but you can set the ToggleButton's `accessibilityDescription` property.

State

The MSAA State of a ToggleButton is a combination of:

- STATE_SYSTEM_UNAVAILABLE (when enabled is false)
- STATE_SYSTEM_FOCUSABLE (when enabled is true)
- STATE_SYSTEM_FOCUSED (when enabled is true and the CheckBox has focus)
- STATE_SYSTEM_PRESSED (when selected is true; not used when state specific names are provided)

When the State changes, a ToggleButton dispatches the MSAA event EVENT_OBJECT_STATECHANGE.

Value

A ToggleButton does not have an MSAA Value.

Location

The MSAA Location of a ToggleButton is its bounding rectangle.

Default Action

The MSAA DefaultAction of a ToggleButton is "Toggle".

When an MSAA client tells the Button to perform this action, KEY_DOWN and KEY_UP MouseEvents for the SPACE key are generated, to simulate pressing the ToggleButton via the keyboard, if the ToggleButton is enabled.

Focus

A ToggleButton accepts focus. When it does so, it dispatches the MSAA event EVENT_OBJECT_FOCUS.

Selection

A ToggleButton does not support selection in the MSAA sense.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | errno : uint Indicates an error code. | AccessibilityImplementation
|  | stub : Boolean Used to create a component accessibility stub. | AccessibilityImplementation

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined By
--- | --- | ---
|  | eventsToHandle : Array [read-only] All subclasses must override this function by returning an array of strings of the events to listen for. | 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
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | ToggleButtonAccImpl(master:UIComponent) Constructor. | ToggleButtonAccImpl
|  | accDoDefaultAction(childID:uint):void An IAccessible method that performs the default action associated with the component that this AccessibilityImplementation represents or of one of its child elements. | AccessibilityImplementation
|  | accLocation(childID:uint):* MSAA method for returning a DisplayObject or Rectangle specifying the bounding box of a child element in the AccessibilityImplementation. | AccessibilityImplementation
|  | accSelect(operation:uint, childID:uint):void IAccessible method for altering the selection in the component that this AccessibilityImplementation represents. | AccessibilityImplementation
|  | enableAccessibility():void [static] Enables accessibility in the ToggleButton class. | ToggleButtonAccImpl
|  | get_accDefaultAction(childID:uint):String MSAA method for returning the default action of the component that this AccessibilityImplementation represents or of one of its child elements. | AccessibilityImplementation
|  | get_accFocus():uint MSAA 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 MSAA method for returning the name for the component that this AccessibilityImplementation represents or for one of its child elements. | AccessibilityImplementation
|  | get_accRole(childID:uint):uint MSAA method for returning the system role for the component that this AccessibilityImplementation represents or for one of its child elements. | AccessibilityImplementation
|  | get_accSelection():Array MSAA method for returning an array containing the IDs of all child elements that are selected. | AccessibilityImplementation
|  | 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
|  | get_accValue(childID:uint):String MSAA method for returning the runtime value of the component that this AccessibilityImplementation represents or of one of its child elements. | AccessibilityImplementation
|  | get_selectionActiveIndex():* | AccessibilityImplementation
|  | get_selectionAnchorIndex():* | AccessibilityImplementation
|  | getChildIDArray():Array Returns an array containing the unsigned integer IDs of all child elements in the AccessibilityImplementation. | AccessibilityImplementation
|  | getFormName(component:UIComponent):String [static] Method for supporting Form Accessibility. | AccImpl
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isAncestorDisabled(component:UIComponent):Boolean [static] Returns true if an ancestor of the component has enabled set to false. | AccImpl
|  | isLabeledBy(labelBounds:Rectangle):Boolean Returns true or false to indicate whether a text object having a bounding box specified by a x, y, width, and height should be considered a label for the component that this AccessibilityImplementation represents. | AccessibilityImplementation
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Protected Methods
Hide Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined By
--- | --- | ---
|  | eventHandler(event:Event):void Generic event handler. | AccImpl
|  | getName(childID:uint):String Returns the name of the accessible component. | AccImpl
|  | getState(childID:uint):uint Utility method to determine state of the accessible component. | AccImpl

Constructor Detail

### ToggleButtonAccImpl

()
Constructor

`public function ToggleButtonAccImpl(master:UIComponent)`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Constructor.

Parameters

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

Method Detail

### enableAccessibility

()
method

`public static function enableAccessibility():void`

Language Version: | ActionScript 3.0

Product Version: | Flex 4

Runtime Versions: | Flash Player 10, AIR 1.5

Enables accessibility in the ToggleButton class.

This method is called by application startup code that is autogenerated by the MXML compiler. Afterwards, when instances of ToggleButton are initialized, their `accessibilityImplementation` property will be set to an instance of this class.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00