Home Tutorial Flex Flex4 Components MX Parallel Effect in Flex4

 
 

MX Parallel Effect in Flex4
Posted on: June 30, 2010 at 12:00 AM
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

Related Tags for MX Parallel 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.