![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Flash Player 6 version 65.
_accProps.propertyName
instanceName
._accProps.propertyName
propertyName
An accessibility property name (see the following description for valid names).
instanceName
The instance name assigned to an instance of a movie clip, button, dynamic text field, or input text field.
Property; lets you control screen reader accessibility options for SWF files, movie clips, buttons, dynamic text fields, and input text fields at runtime. These properties override the corresponding settings available in the Accessibility panel during authoring. For changes to these properties to take effect, you must call Accessibility.updateProperties()
. For information on the Accessibility panel, see The Flash Accessibility panel (you may need to update your Help system to see this information).
To determine whether the player is running in an environment that supports accessibility aids, use System.capabilities.hasAccessibility
.
The following table lists the name and data type of each _accProps
property, its equivalent setting in the Accessibility panel, and the kinds of objects to which the property can be applied. The term inverse logic means that the property setting is the inverse of the corresponding setting in the Accessibility panel. For example, setting the silent
property to true
is equivalent to deselecting the Make Movie Accessible or Make Object Accessible option.
Property |
Data type |
Equivalent in Accessibility panel |
Applies to |
---|---|---|---|
silent
|
Boolean |
Make Movie Accessible/ Make Object Accessible (inverse logic) |
Whole movies Movie clips Buttons Dynamic text Input text |
forceSimple
|
Boolean |
Make Child Objects Accessible (inverse logic) |
Whole movies Movie clips |
name
|
String |
Name |
Whole movies Movie clips Buttons Input text |
description
|
String |
Description |
Whole movies Movie clips Buttons Dynamic text Input text |
shortcut
|
String |
Shortcut&DATA; |
Movie clips Buttons Input text |
*
For information on assigning a keyboard shortcut to an accessible object, see Key.addListener()
.
To specify settings that correspond to the Tab index setting in the Accessibility panel, use the Button.tabIndex
, MovieClip.tabIndex
, or TextField.tabIndex
property.
There is no way to specify an Auto Label setting at runtime.
When used without the instanceName
parameter, changes made to _accProps
properties apply to the whole movie. For example, the following code sets the Accessibility name
property for the whole movie to the string "Pet Store"
, and then calls Accessibility.updateProperties()
to effect that change.
_accprops.name = "Pet Store"; Accessbility.updateProperties();
In contrast, the following code sets the name
property for a movie clip with the instance name price_mc
to the string "Price"
:
price_mc._accProps.name = "Price"; Accessbility.updateProperties();
If you are specifying several accessibility properties, make as many changes as you can before calling Accessibility.updateProperties()
, instead of calling it after each property statement:
_accprops.name = "Pet Store"; animal_mc._accProps.name = "Animal"; animal_mc._accProps.description = "Cat, dog, fish, etc."; price_mc._accProps.name = "Price"; price_mc._accProps.description = "Cost of a single item"; Accessbility.updateProperties();
If you don't specify an accessibility property for a movie or an object, any values set in the Accessibility panel are implemented.
After you specify an accessibility property, you can't revert its value to a value set in the Accessibility panel. However, you can set the property to its default value (false
for Boolean values, empty strings for string values) by deleting the _accProps
object:
my_mc._accProps.silent = true; // set a property // other code here delete my_mc._accProps.silent; // revert to default value
To revert all accessibility values for an object to default values, you can delete the instanceName
._accProps
object:
delete my_btn._accProps;
To revert accessibility values for all objects to default values, you can delete the global _accProps
object:
delete _accProps;
If you specify a property for an object type that doesn't support that property, the property assignment is ignored and no error is thrown. For example, the forceSimple
property isn't supported for buttons, so a line like the following is ignored:
my_btn._accProps.forceSimple = false; //ignored
Here is some example ActionScript code that takes advantage of dynamic accessibility properties. You would assign this code to a nontextual icon button component that can change which icon it displays.
function setIcon( newIconNum, newTextEquivalent ) { this.iconImage = this.iconImages[ newIconNum ]; if ( newTextEquivalent != undefined ) { if ( this._accProps == undefined ) this._accProps = new Object(); this._accProps.name = newTextEquivalent; Accessibility.updateProperties(); } }
Accessibility.isActive()
, Accessibility.updateProperties()
, System.capabilities.hasAccessibility
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |