Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Button component | |||
The Button component is a resizable rectangular user interface button. You can add a custom icon to a button. You can also change the behavior of a button from push to toggle. A toggle button stays pressed when clicked and returns to its up state when clicked again.
|
NOTE |
|
A Button component is supported for both ActionScript 2.0 and ActionScript 3.0. This document discusses the version 2 component. If you are using the version 3 component, see Using the Button in Using ActionScript 3.0 Components. |
A button can be enabled or disabled 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+ |
Moves focus to the previous object. |
|
Spacebar |
Presses or releases the component and triggers the |
|
|
Moves focus to the next object. |
For more information about controlling focus, see FocusManager class or Creating custom focus navigation in Using ActionScript 2.0 Components.
A live preview of each Button instance reflects changes made to parameters in the Property inspector or Component inspector during authoring. However, in the live preview a custom icon is represented on the Stage by a gray square.
When you add the Button component to an application, you can use the Accessibility panel to make it accessible to screen readers. First, you must add the following line of code:
mx.accessibility.ButtonAccImpl.enableAccessibility();
You enable accessibility for a component only once. regardless of how many instances you have of the component.
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/00002578.html