Spark Scale Effect in Flex4


 

Spark Scale Effect in Flex4

The Scale effect is used for change the size of component or target.

The Scale effect is used for change the size of component or target.

Spark Scale Effect in Flex4:

The Scale effect is used for change the size of component or target. You can change the scaling in both x and y direction. The tag of Scale effect is <s:Scale>. The syntax of Scale effect is following:

<s:scale
id=""
scaleXFrom=""
scaleXto=""
scaleYFrom=""
scaleYTo=""
duration=""
/>

In this example you can see how we can use a Scale effect With components.

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:Bounce id="bounceEasing"/>

<s:Scale id="scale"

duration="500"

scaleXFrom="1.0"

scaleXTo="2.0"

scaleYFrom="1.0"

scaleYTo="2.0"

target="{vbox}"

easer="{bounceEasing}"/>

<s:Scale id="scaleresize"

duration="500"

scaleXFrom="2.0"

scaleXTo="1.0"

scaleYFrom="2.0"

scaleYTo="1.0"

target="{vbox}"

easer="{bounceEasing}"/>

</fx:Declarations>

<s:Panel title="Spark Scale effect Example"

chromeColor="#000000"

color="#CCCCCC"

width="398"

0

height="274">

<mx:ApplicationControlBar width="396"

horizontalAlign="center">

1

<s:Label text="Click on Buttons for showing the effect"

color="#000000"

fontFamily="Verdana"/>

2

</mx:ApplicationControlBar>

<mx:VBox id="vbox"

width="136"

3

height="81"

horizontalAlign="center"

verticalAlign="middle"

4

x="35" y="58"

backgroundColor="#555555"

borderStyle="solid">

5

<s:Button label="Scale"

id="btn"

cornerRadius="10"

6

fontFamily="Verdana"

click="{scale.end();scale.play();}"/>

<s:Button label="Scale Resize"

7

id="btn1"

cornerRadius="10"

fontFamily="Verdana"

8

click="{scaleresize.end();scaleresize.play();}"/>

</mx:VBox>

</s:Panel>

9

&</s:Application>

Output:/h3>

Running Application:

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

0

Download this code

Ads