Search Flex Components Free

Custom Search

December 25, 2007

Flex Zoom Effect Source Code

Flex Custom Effects Defined Declaratively Sample Source Code:

Create a file:
ZoomEffectsDemo.mxml


<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundAlpha="0">

<mx:Zoom id="zoomIn" zoomWidthTo="1" zoomHeightTo="1" />
<mx:Zoom id="zoomOut" zoomWidthTo=".5" zoomHeightTo=".5" />

<mx:Panel title="Zoom Demo" width="100%" height="100%" horizontalAlign="center">

<mx:Label text="Mouse over the image to enlarge it"/>

<mx:Canvas id="canvas" width="100%" height="100%">

<mx:Image id="img" x="{canvas.width/2 - img.width/2}" y="{canvas.height/2 - img.height/2}"
source="@Embed('../assets/products/Nokia_6630.png')"
scaleX=".5" scaleY=".5"
rollOverEffect="zoomIn"
rollOutEffect="zoomOut"/>

</mx:Canvas>

</mx:Panel>

</mx:Application>

Related Flex Tutorials