Share on Google+Share on Google+

MX Parallel Effect in Flex4

Advertisement
The parallel Effect plays multiple child effects at the same time.

MX Parallel Effect in Flex4:

The parallel Effect plays multiple child effects at the same time. The tag of parallel Effect is <mx:Parallel>. In this example you can see how we can use parallel Effect in 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>

<s:Sequence id="fadeResizeHide"

target="{roseindia}"

duration="500">

<s:Resize id="resizeHide"

widthTo="0"

heightTo="0"/>

<s:Fade id="fadeHide"

alphaFrom="1.0"

alphaTo="0.0"/>

</s:Sequence>

<!-- Parallel Effect -->

<s:Parallel id="fadeResizeShow"

target="{roseindia}"

duration="500">

<s:Fade id="fadeShow"

alphaFrom="0.0"

alphaTo="1.0"/>

<s:Resize id="resizeShow"

widthTo="247"

heightTo="85"/>

</s:Parallel>

<s:RadioButtonGroup id="showHide" change="imageShow()"/>

</fx:Declarations>

<fx:Script>

<![CDATA[

public function imageShow():void{

if(show.selected == true){

roseindia.visible == true;

}if(hide.selected == true){

roseindia.visible == false;

}

}

]]>

</fx:Script>

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

width="439" height="282"

chromeColor="#555555" color="#CCCCCC">

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

<mx:RadioButton groupName="showHide" id="show"

label="Show"

color="#000000"

selected="true"

click="fadeResizeShow.end();

fadeResizeShow.play();"/>

<mx:RadioButton groupName="showHide"

id="hide"

label="Hide"

color="#000000" click="fadeResizeHide.end();

fadeResizeHide.play();"/>

</mx:ApplicationControlBar>

<mx:Image id="roseindia"

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

x="99" y="90"/>

</s:Panel>

&</s:Application>

Output:/h3>

Running Application:

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

Download this code

Advertisements

Posted on: June 30, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.