MX AnimateProperty in Flex4

The AnimateProperty Effect is used to animate a numeric property of a component.

 
 

Share on Google+Share on Google+

MX AnimateProperty in Flex4

Ads

The AnimateProperty Effect is used to animate a numeric property of a component.

MX AnimateProperty Effect in Flex4:

The AnimateProperty Effect is used to animate a numeric property of a component.
The tag of Animateproperty is <mx:Animateproperty>. In this example we use the scaleX property for animate the component.

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>

<mx:AnimateProperty

id="show"

property="scaleX"

fromValue="1.0"

toValue="2.0"/>

<mx:AnimateProperty

id="hide"

property="scaleX"

fromValue="2.0"

toValue="1.0"/>

</fx:Declarations>

<s:Panel title="MX AnimateProperty Effect Example"

width="402" height="239"

chromeColor="#000000" color="#CCCCCC">

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

<s:Label text="Take cursor on image and show the effect."

fontFamily="verdana" color="#000000"/>

</mx:ApplicationControlBar>

<mx:Image id="roseindia"

source="@Embed(source='file:/C:/work/bikrant/image/bus.png')"

x="58" y="49"

rollOverEffect="{show}"

rollOutEffect="{hide}"/>

</s:Panel>

</s:Application>

Output:

Running Application:

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

Download this code

Advertisements

Ads

Posted on: June 30, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles