Spark Rotate Effect in Flex4


 

Spark Rotate Effect in Flex4

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

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"

0

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

x="148" y="56"

rollOverEffect="{rotateClockWise}"

1

rollOutEffect="{rotateAntiClockWise}"/>

</s:Panel>

2

</s:Application>

Output:

Running Application:

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

3

Download this code

Ads