This example creates the check box in ActionScript, and then resizes the label when checked.
For this example, drag a CheckBox component from the Components panel to the current
document's library (so the CheckBox 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, "my_ch", 10, {label:"Resize
CheckBox instance"});
function checkboxHandler(evt_obj:Object):Void {
trace("before: " + evt_obj.target.width +"px wide");
evt_obj.target.setSize(200, evt_obj.target.height);
trace("after: " + evt_obj.target.width+"px wide");
}
my_ch.addEventListener("click", checkboxHandler);
See also
CheckBox.labelPlacement
CheckBox.labelPlacement
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
checkBoxInstance.labelPlacement
Description
Property; a string that indicates the position of the label in relation to the check box. The
following are the four possible values (the dotted lines represent the bounding area of the
component; they are invisible in a document):
The check box is pinned to the upper-left corner of the bounding area. The
"right"
label is set to the right of the check box. This is the default value.
The check box is pinned to the upper-right corner of the bounding area. The
"left"
label is set to the left of the check box.
CheckBox.labelPlacement
143
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers