User Guide

144 CheckBox component
"bottom" The label is set below the check box. The check box and label are centered
horizontally and vertically.
"top" The label is placed below the check box. The check box and label are centered
horizontally and vertically.
You can change the bounding area of a component while authoring by using the
Transform command or at runtime using the
UIObject.setSize() property. For more
information, see “Customizing the CheckBox component” on page 132.
Example
The following example sets the placement of the label to the left of the check box:
checkBox_mc.labelPlacement = "left";
The following example uses ActionScript to create check box instances. The check box
instance
right_ch has its label and labelPlacement properties set within the method
“UIObject.createClassObject()” on page 1362. The check box instance
left_ch has its label
and labelPlacement properties set in separate declarations. Drag the CheckBox component
from the Components panel to the current document’s library (so the component appears in
your library, but not on the Stage). Then add the following ActionScript to the first frame of
the main timeline:
this.createClassObject(mx.controls.CheckBox, "right_ch", 1, {label:"Right",
labelPlacement:"right"});
right_ch.move(10, 10);
this.createClassObject(mx.controls.CheckBox, "left_ch", 2);
left_ch.label= "Left";
left_ch.labelPlacement = "left";
left_ch.move(10, 30);
See also
CheckBox.label