Category Archives: Button

Setting the fill colors on a Halo Button control in Flex 4

The following example shows how you can set the fill colors on a Halo Button control (with default Spark skin) in Flex 4 by creating a custom skin and setting the gradient colors in the fill layer:

<!-- layer 2: fill -->
<s:rect left="1" right="1" top="1" bottom="1"
        radiusX="2" radiusY="2">
    <s:fill>
        <s:lineargradient rotation="90">
            <s:gradiententry color="red"
                    color.overStates="haloGreen"
                    alpha="0.85"
                    alpha.selectedOver="1"></s:gradiententry>
            <s:gradiententry color="haloOrange"
                    color.overStates="haloBlue"
                    alpha="0.85"
                    alpha.selectedOver="1"></s:gradiententry>
        </s:lineargradient>
    </s:fill>
</s:rect>

Full code after the jump.

Continue reading Setting the fill colors on a Halo Button control in Flex 4

Detecting when the label placement changes on a Button control in Flex

In an earlier example, “Positioning an icon within a button using the Button.labelPlacement property”, we saw how you can set a Flex Button control’s label placement using the labelPlacement property.

The following example shows how you can detect when the labelPlacement property has changed using the labelPlacementChanged event.

Full code after the jump.

Continue reading Detecting when the label placement changes on a Button control in Flex