From the category archives:

ToggleButton (Spark)

In a previous example, “Styling specific states in a Spark ToggleButton control in Flex 4″, we saw how to style specific states in a Flex 4 Spark ToggleButton control using CSS by specifying the state name after the control name in the <Script> block.

The following example shows how you can set styles on specific states on a Flex 4 Spark ToggleButton control using ActionScript.

Full code after the jump.

[click to continue…]

{ 0 comments }

The following example shows how you can style specific states in a Flex 4 Spark ToggleButton control using CSS by specifying the state name after the control name in the <Script> block. In this example the base color for all the states is set to red and then overridden in the “upAndSelected”, “overAndSelected”, “downAndSelected”, and “disabledAndSelected” states and set to haloGreen.

And a huge thanks to my co-worker, Joan “Tan” Lafferty for explaining Advanced CSS to me! And for more information on Advanced CSS tricks, check out the “CSS Advanced Selectors – Functional and Design Specification” on the Flex 4 page at the opensource.adobe.com website.

Full code after the jump.

[click to continue…]

{ 1 comment }

The following example shows how you can determine when the Flex 4 Spark ToggleButton control is selected or deselected by listening for the change event and checking the Boolean selected property.

Full code after the jump.

[click to continue…]

{ 0 comments }