EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 270

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
270 Chapter 12: ActionScript Dictionary
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 dont 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 cant 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 doesnt support that property, the property
assignment is ignored and no error is thrown. For example, the
forceSimple property isnt
supported for buttons, so a line like the following is ignored:
my_btn._accProps.forceSimple = false; //ignored
Example
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();
}
}
See also
Accessibility.isActive()
, Accessibility.updateProperties(),
System.capabilities.hasAccessibility

Table of Contents

Related product manuals