You
can enable or disable a button in an application. In the disabled
state, a button doesn’t receive mouse or keyboard input. An enabled
button receives focus if you click it or tab to it. When a Button
instance has focus, you can use the following keys to control it:
Key
|
Description
|
Shift+Tab
|
Moves focus to the previous object.
|
Spacebar
|
Presses or releases the button and triggers
the
click
event.
|
Tab
|
Moves focus to the next object.
|
Enter/Return
|
Moves focus to the next object if a button
is set as the FocusManager’s default Button.
|
For more information about controlling focus, see the IFocusManager
interface and the FocusManager class in the
ActionScript 3.0 Reference for the Adobe
Flash Platform
and
Work with FocusManager
.
A live preview of each Button instance reflects changes made
to parameters in the Property inspector or Component inspector during
authoring.
Note:
If an icon is larger than the button, it extends
beyond the button’s borders.
To designate a button as the default push button in an application
(the button that receives the click event when a user presses Enter),
set
FocusManager.defaultButton
. For example, the
following code sets the default button to be a Button instance called
submitButton
.
FocusManager.defaultButton = submitButton;
When you add the Button component to an application, you can
make it accessible to a screen reader by adding the following lines
of ActionScript code:
import fl.accessibility.ButtonAccImpl;
ButtonAccImpl.enableAccessibility();
You enable accessibility for a component only once, regardless
of how many instances you create.