MX Parallel Effect in Flex4


 

MX Parallel Effect in Flex4

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

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>

0

<fx:Script>

<![CDATA[

public function imageShow():void{

1

if(show.selected == true){

roseindia.visible == true;

}if(hide.selected == true){

2

roseindia.visible == false;

}

}

3

]]>

</fx:Script>

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

4

width="439" height="282"

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

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

5

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

label="Show"

color="#000000"

6

selected="true"

click="fadeResizeShow.end();

fadeResizeShow.play();"/>

7

<mx:RadioButton groupName="showHide"

id="hide"

label="Hide"

8

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

fadeResizeHide.play();"/>

</mx:ApplicationControlBar>

9

<mx:Image id="roseindia"

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

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

0

</s:Panel>

&</s:Application>

Output:/h3>

1

Running Application:

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

Download this code

2

Ads