Flash CS3 Documentation |
|||
| Using ActionScript 3.0 Components > Using the UI Components > Using the Button > User interaction with the Button | |||
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 |
|
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 Language and Components Reference and Working 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.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000421.html