Search Flex Components Free

Custom Search

August 25, 2009

Creating an animated base color effect on a Spark Button control in Flex 4

The following example shows how you can create an animating background effect on a Spark Button control in Flex 4 by using the AnimateColor effect on the baseColor style.

Full code after the jump.

"1.0" encoding="utf-8"?>   name="Spark_Button_AnimateColor_baseColor_test"         xmlns:fx="http://ns.adobe.com/mxml/2009"         xmlns:s="library://ns.adobe.com/flex/spark"         xmlns:mx="library://ns.adobe.com/flex/halo">       >          id="animatr"                 target="{btn}"                 colorFrom="haloSilver"                 colorTo="haloBlue"                 colorPropertyName="baseColor"                 duration="400"                 repeatCount="0"                  repeatBehavior="reverse" />     >        id="btn"             label="Spark Button"             horizontalCenter="0" verticalCenter="0"             creationComplete="animatr.play();"/>   >

View source is enabled in the following example.

Related Flex Tutorials