Spark AnimateColor effect in Flex4


 

Spark AnimateColor effect in Flex4

Spark AnimateColor effect changes the color property of the component or target.

Spark AnimateColor effect changes the color property of the component or target.

Spark AnimateColor effect in Flex4:

Spark AnimateColor effect changes the color property of the component or target.
The tag of AnimateColor effect is <s:AnimateColor>. The syntax of AnimateColor effect is following:

<s:AnimateColor
id=""
colorFrom=""
colorTo=""
duration=""
/>

Example:

<?xml version="1.0" encoding="utf-8"?>

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx"

minWidth="955" minHeight="600">

<fx:Declarations>

<s:AnimateColor id="animateColorON"

colorFrom="#FFFFFF"

colorTo="#FF0000"

duration="100"/>

<s:AnimateColor id="animateColorOFF"

colorFrom="#FF0000"

colorTo="#FFFFFF"

duration="100"/>

</fx:Declarations>

<s:Panel title="Spark AnimateColor Effect Example"

chromeColor="#000000"

color="#CCCCCC" width="309" height="184">

<mx:ApplicationControlBar horizontalAlign="center" width="307">

<s:Label text="Mouse over on button and show the effect"

color="#000000"

fontFamily="Verdana"/>

</mx:ApplicationControlBar>

<s:Button id="btn"

label="Spark AnimateColor Effect"

x="54" y="62"

fontFamily="Verdana"

height="37"

rollOverEffect="{animateColorON}"

0

rollOutEffect="{animateColorOFF}"

cornerRadius="20"

fontWeight="bold"

1

color="#FFFFFF"/>

</s:Panel>

&</s:Application>

2

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Ads