Home Tutorial Flex Flex4 Components MX Zoom Effect in Flex4

 
 

MX Zoom Effect in Flex4
Posted on: June 30, 2010 at 12:00 AM
The component will zoom in or out on a center point using Zoom effect.

MX Zoom Effect in Flex4:

The component will zoom in or out on a center point using Zoom effect. The tag of Zoom effect is <mx:Zoom>. The syntax is following:

<mx:Zoom
id="ID"
originX="Calculated"
originY="Calculated"
zoomWidthFrom="0.01"
zoomWidthTo="1.0"
zoomHeightFrom="0.01"
zoomHeightTo="1.0"
/>

In this example you can see how we can use a Zoom effect in your application.

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:Zoom id="zoomIn"

originX="80"

originY="80"

zoomHeightTo="1.5"

zoomWidthTo="1.5"

duration="500"/>

<mx:Zoom id="zoomOUT"

originX="80"

originY="80"

zoomHeightTo="1.0"

zoomWidthTo="1.0"

duration="500"/>

</fx:Declarations>

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

width="487" height="275"

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

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

<s:Label text="Take a 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/ball1.png')"

x="171" y="74"

rollOverEffect="{zoomIn}" rollOutEffect="{zoomOUT}"

width="128" height="128"/>

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

Related Tags for MX Zoom Effect in Flex4:


Ask Questions?

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.