User interaction with the CheckBox

You can enable or disable a CheckBox in an application. If a CheckBox is enabled and a user clicks it or its label, the CheckBox receives input focus and displays its pressed appearance. If a user moves the pointer outside the bounding area of a CheckBox or its label while pressing the mouse button, the component's appearance returns to its original state and retains input focus. The state of a CheckBox does not change until the mouse is released over the component. Additionally, the CheckBox has two disabled states, selected and deselected, which use selectedDisabledSkin and disabledSkin, respectively, that do not allow mouse or keyboard interaction.

If a CheckBox is disabled, it displays its disabled appearance, regardless of user interaction. In the disabled state, a CheckBox 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 change event.

Tab

Moves focus to the next element.

For more information about controlling focus, see Working with FocusManager and the FocusManager class in the ActionScript 3.0 Language and Components Reference.

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 make it accessible to a screen reader by adding the following lines of ActionScript code:

import fl.accessibility.CheckBoxAccImpl;

CheckBoxAccImpl.enableAccessibility();

You enable accessibility for a component only once, regardless of how many instances you have of the component.