![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
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.
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 + Tab |
Moves focus to the previous object. |
Spacebar |
Presses or releases the component and triggers the |
Tab |
Moves focus to the next object. |
For more information about controlling focus, see Creating custom focus navigation or FocusManager class.
A live preview of each Button instance reflects changes made to parameters in the Property inspector or Component Inspector panel while 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 to enable accessibility for the Button component:
mx.accessibility.ButtonAccImpl.enableAccessibility();
You only enable accessibility for a component once no matter how many instances you have of the component. For more information, see Creating Accessible Content.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |