Mega Code Archive

 
Categories / Flex / Effects
 

Enable Composite Effects

<!-- Code from Flex 4 Documentation "Using Adobe Flex 4". This user guide is licensed for use under the terms of the Creative Commons Attribution  Non-Commercial 3.0 License.  This License allows users to copy, distribute, and transmit the user guide for noncommercial  purposes only so long as    (1) proper attribution to Adobe is given as the owner of the user guide; and    (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms.  The best way to provide notice is to include the following link.  To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ -->     <!-- behaviors\CompositeEffectsEnable.mxml --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"     xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark">     <s:layout>         <s:VerticalLayout />     </s:layout>     <fx:Script>                    private function showHandler():void {              myButton2.enabled=true;              myButton1.enabled=false;          }          private function hideHandler():void {              myButton2.enabled=false;              myButton1.enabled=true;          }             </fx:Script>     <fx:Declarations>         <s:Sequence id="fadeResizeHide" target="{aTextArea}"             duration="1000" effectEnd="hideHandler();">             <s:Fade id="fadeHide" alphaFrom="1.0" alphaTo="0.0" />             <s:Resize id="resizeHide" widthTo="0" heightTo="0" />         </s:Sequence>         <s:Parallel id="fadeResizeShow" target="{aTextArea}"             duration="1000" effectEnd="showHandler();">             <s:Resize id="resizeShow" widthTo="100" heightTo="50" />             <s:Fade id="fadeShow" alphaFrom="0.0" alphaTo="1.0" />         </s:Parallel>     </fx:Declarations>     <s:TextArea id="aTextArea" width="100" height="50" text="Hello world." />     <s:Button id="myButton2" label="Hide!"         click="fadeResizeHide.end();fadeResizeHide.play();" />     <s:Button id="myButton1" label="Show!" enabled="false"         click="fadeResizeShow.end();fadeResizeShow.play();" /> </s:Application>