ActionScript 2.0 Components Language Reference |
|
|
|
| CheckBox component | |||
A check box is a square box that can be selected or deselected. When it is selected, a check mark appears in the box. You can add a text label to a check box and place it to the left, right, top, or bottom.
|
NOTE |
A CheckBox 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 CheckBox in Using ActionScript 3.0 Components. |
A check box can be enabled or disabled in an application. If a check box is enabled and a user clicks it or its label, the check box receives input focus and displays its pressed appearance. If a user moves the pointer outside the bounding area of a check box or its label while pressing the mouse button, the component's appearance returns to its original state and it retains input focus. The state of a check box does not change until the mouse is released over the component. Additionally, the check box has two disabled states, selected and deselected, which do not allow mouse or keyboard interaction.
If a check box is disabled, it displays its disabled appearance, regardless of user interaction. In the disabled state, a button doesn't receive mouse or keyboard input.
A CheckBox instance receives focus if a user clicks it or tabs to it. When a CheckBox instance has focus, you can use the following keys to control it:
|
Key |
Description |
|---|---|
|
Shift+Tab |
Moves focus to the previous element. |
|
Spacebar |
Selects or deselects the component and triggers the |
|
Tab |
Moves focus to the next element. |
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 CheckBox instance reflects changes made to parameters in the Property inspector or Component inspector during authoring.
When you add the CheckBox 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:
mx.accessibility.CheckBoxAccImpl.enableAccessibility();
You enable accessibility for a component only once, regardless of how many instances you have of the component. For more information, see "Creating accessible content" in Using Flash.
|
|
|
|