Share on Google+Share on Google+

Spark Rotate Effect in Flex4

Advertisement
The Rotate effect rotates a component. You can set the starting and ending angle of rotation.

Spark Rotate Effect in Flex4:

The Rotate effect rotates a component. You can set the starting and ending angle of rotation. The syntax of Rotate effect is following:

<s:Rotate
id=""
angleFrom=""
angleTo=""
duration=""
/>

The tag of Rotate effect is <s:Rotate>. In this example you can see how we can use a Rotate effect with 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>

<s:Rotate id="rotateClockWise"

angleFrom="0"

angleTo="360"

duration="1000"

autoCenterTransform="true"/>

<s:Rotate id="rotateAntiClockWise"

angleFrom="360"

angleTo="0"

duration="1000"

autoCenterTransform="true"/>

</fx:Declarations>

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

chromeColor="#000000"

color="#CCCCCC"

width="434"

height="236">

<mx:ApplicationControlBar width="432"

horizontalAlign="center">

<s:Label text="Mouse over on image for showing the effect"

color="#000000"

fontFamily="Verdana"/>

</mx:ApplicationControlBar>

<mx:Image id="globe"

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

x="148" y="56"

rollOverEffect="{rotateClockWise}"

rollOutEffect="{rotateAntiClockWise}"/>

</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

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

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.