Creating accessibility with actionscript – Adobe Flash Professional CC 2014 v.13.0 User Manual
Page 941

Create a keyboard shortcut
1. On the Stage, select the button or input text field to create a keyboard shortcut for.
2. Select Window > Other Panels > Accessibility.
3. In the Shortcut field, type the name of the keyboard shortcut, using the following conventions:
Spell out key names, such as Control or Alt.
Use capital letters for alphabetic characters.
Use a plus sign (+) between key names, with no spaces (for example, Control+A).
Important: Flash Professional does not check that the ActionScript to code the keyboard shortcut was created.
Map a keyboard shortcut to a button instance Control+7 to myButton instance
1. Select the object on the Stage, display the Accessibility panel, and in the Shortcut field, type the key combination of the shortcut. For
example, Control+7.
2. Enter the following ActionScript 2.0 code in the Actions panel:
Note: In this example the shortcut is Control+7.
function myOnPress() {
trace( "hello" );
}
function myOnKeyDown() {
if (Key.isDown(Key.CONTROL) && Key.getCode() == 55) // 55 is key code for 7
{
Selection.setFocus(myButton);
myButton.onPress();
}
}
var myListener = new Object();
myListener.onKeyDown = myOnKeyDown;
Key.addListener(myListener);
myButton.onPress = myOnPress;
myButton._accProps.shortcut = "Ctrl+7"
Accessibility.updateProperties();
Note: The example assigns the Control+7 keyboard shortcut to a button with an instance name of myButton and makes information about the
shortcut available to screen readers. In this example, when you press Control+7, the myOnPress function displays the text “hello” in the Output
panel. See addListener (IME.addListener method) in ActionScript 2.0 Language Reference at
Creating accessibility with ActionScript
About ActionScript and accessibility
You can create accessible documents with ActionScript® code. For accessibility properties that apply to the entire document, you can create or
modify a global variable called _accProps. See the _accProps property in ActionScript 2.0 Language Reference at
For properties that apply to a specific object, you can use the syntax instancename._accProps. The value of _accProps is an object that can
include any of the following properties:
Property
Type
Equivalent selection in the
Accessibility panel
Applies to
.silent
Boolean
Make Movie Accessible/Make
Object Accessible (inverse
logic)
Entire documents
Buttons
Movie clips
Dynamic text
Input text
.forceSimple
Boolean
Make Child Objects Accessible
(inverse logic)
Entire documents
Movie clips
.name
string
Name
Entire documents
Buttons
934