<?xml version="1.0" encoding="utf-8"?> <!--- Effect Sample (CrossFade) --> <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/halo" minWidth = "1024" minHeight = "768" viewSourceURL = "srcview/index.html" > <fx:Style> @namespace mx "library://ns.adobe.com/flex/halo"; @namespace s "library://ns.adobe.com/flex/spark"; s|Button { font-size : 40; } </fx:Style> <fx:Script> <![CDATA[ import spark.effects.WipeDirection; protected override function createChildren() : void { super.createChildren(); currentState = "aState"; } ]]> </fx:Script> <s:layout> <s:VerticalLayout horizontalAlign="center" /> </s:layout> <s:states> <mx:State name="aState" /> <mx:State name="bState" /> </s:states> <s:transitions> <s:Transition> <s:Parallel duration="5000"> <s:CrossFade target="{button}" /> </s:Parallel> </s:Transition> </s:transitions> <s:Button id = "button" width = "400" height = "100" label.aState = "crossfade" label.bState = "CROSSFADE" click = "currentState= (currentState=='aState') ? 'bState' : 'aState'" /> </s:Application>