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.
|
<?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"height=" 274"> <mx:ApplicationControlBar width="396"horizontalAlign=" center"> <s:Label text="Click on Buttons for showing the effect"color=" #000000"fontFamily=" Verdana"/> </mx:ApplicationControlBar> <mx:VBox id="vbox"width=" 136"height=" 81"horizontalAlign=" center"verticalAlign=" middle"x=" 35" y="58"backgroundColor=" #555555"borderStyle=" solid"> <s:Button label="Scale"id=" btn"cornerRadius=" 10"fontFamily=" Verdana"click="{scale.end();scale.play();}" /> <s:Button label="Scale Resize"id=" btn1"cornerRadius=" 10"fontFamily=" Verdana"click="{scaleresize.end();scaleresize.play();}" /> </mx:VBox> </s:Panel>&</s:Application> |

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.