User Guide

130 CheckBox component
You enable accessibility for a component only once, regardless of how many instances you
have of the component. For more information, see Chapter 19, “Creating Accessible
Content,” in Using Flash.
Using the CheckBox component
A check box is a fundamental part of any form or web application. You can use check boxes
wherever you need to gather a set of
true or false values that arent mutually exclusive. For
example, a form collecting personal information about a customer could have a list of hobbies
for the customer to select; each hobby would have a check box beside it.
CheckBox parameters
You can set the following authoring parameters for each CheckBox component instance in the
Property inspector or in the Component inspector:
label sets the value of the text for the check box; the default value is CheckBox.
labelPlacement orients the label text for the check box. This parameter can be one of four
values:
left, right, top, or bottom; the default value is right. For more information, see
CheckBox.labelPlacement.
selected sets the initial value of the check box to checked (true) or unchecked (false). The
default value is
false.
You can write ActionScript to control these and additional options for the CheckBox
component using its properties, methods, and events. For more information, see “CheckBox
class” on page 135.
Creating an application with the CheckBox
component
The following procedure explains how to add a CheckBox component to an application while
authoring. The following example is a form for an online dating application. The form is a
query that searches for possible dating matches for the customer. The query form must have a
check box labeled Restrict Age that permits customers to restrict their search to a specified age
group. When the Restrict Age check box is selected, the customer can then enter the
minimum and maximum ages into two text fields. (These text fields are enabled only when
the check box is selected.)