Using styles with the CheckBox

You can set style properties to change the appearance of a CheckBox instance. For example, the following procedure changes the size and color of a CheckBox label.

To change the size and color of a CheckBox label:

  1. Drag the CheckBox component from the Components panel to the Stage and give it an instance name of myCb.
  2. Click the Parameters tab in the Property inspector and enter the following value for the label parameter: Less than $500?
  3. On Frame 1 of the main Timeline, enter the following code in the Actions Panel:
    var myTf:TextFormat = new TextFormat();
    myCb.setSize(150, 22);
    myTf.size = 16;
    myTf.color = 0xFF0000;
    myCb.setStyle("textFormat", myTf);
    

For more information, see Setting styles. For information on setting style properties to change the component's icons and skins, see Creating a new skin and Using skins with the CheckBox.