<?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" creationComplete="init()" > <s:layout> <s:VerticalLayout/> </s:layout> <s:states> <s:State name="orange"/> <s:State name="black"/> </s:states> <s:transitions> <s:Transition fromState="*" toState="*"> <s:Resize target="{box}"/> </s:Transition> </s:transitions> <s:HGroup> <s:Button label.orange="Black" label.black="Orange"> <s:click> <![CDATA[ currentState = (currentState == 'orange'?'black':'orange'); ]]> </s:click> </s:Button> </s:HGroup> <s:Rect id="box" width="200" height="200" width.black="150" height.black="150"> <s:fill> <s:SolidColor color.black="#000000" color.orange="#de7800"/> </s:fill> </s:Rect> </s:Application>