User Guide

CheckBox.selected 145
CheckBox.selected
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
checkBoxInstance.selected
Description
Property; a Boolean value that selects (true) or deselects (false) the check box.
Example
The following example shows a check box that has its selected property set to true, by
default, and then uses the
selected property within an event handler function to respond to
the user clicking the check box. Drag the CheckBox component to the Stage. Give the
component instance the name
my_ch. Then, add the following code to the Actions panel of
the first frame of the main timeline:
my_ch.selected = true;
var checkboxListener:Object = new Object();
checkboxListener.click = function(evt_obj:Object) {
if (evt_obj.target.selected) {
evt_obj.target.label = "Selected!";
} else {
evt_obj.target.label = "Unselected!";
}
};
my_ch.addEventListener("click", checkboxListener);