=》状态(A):
Orange状态(默认)
Black状态
<?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="1024" minHeight="768" pageTitle="TheStudioOfCenyebao">
<!-- Demo_视图状态 A-->
<!--为Application定义两个状态:orange(默认状态,因为在首位)、black-->
<s:states>
<s:State name="orange" />
<s:State name="black" />
</s:states>
<!--view-->
<s:VGroup verticalCenter="0" horizontalCenter="0">
<s:HGroup>
<s:Button label="Orange" click="currentState='orange'" />
<s:Button label="Black" click="currentState='black'" />
</s:HGroup>
<s:Rect width="350" height="250">
<s:fill>
<s:SolidColor color.black="#000000" color.orange="#de7800"/>
</s:fill>
</s:Rect>
</s:VGroup>
</s:Application>
=》状态(B):
Orange状态(默认)
Black状态
<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="1024" minHeight="768" pageTitle="TheStudioOfCenyebao">
<!-- Demo_视图状态B -->
<!--为Application定义两个状态:orange(默认状态,因为在首位)、black-->
<s:states>
<s:State name="orange" />
<s:State name="black" />
</s:states>
<!--view-->
<s:VGroup verticalCenter="0" horizontalCenter="0">
<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 width.orange="200" height.orange="80" width.black="100" height.black="80">
<s:fill>
<s:SolidColor color.black="#000000" color.orange="#de7800"/>
</s:fill>
</s:Rect>
</s:VGroup>
</s:Application>