The parallel Effect plays multiple child effects at the same time.
The parallel Effect plays multiple child effects at the same time.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.
<?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> |