<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="down" />
</s:states>
一旦声明了states数组,那么第一个元素将作为currentState的值。
组件的
button将在状态up和over中出现
<Button label="Click Me" includeIn="up, over"/>
button除了down状态之外的其他中状态中出现
<Button label="Button C" excludeFrom="down"/>
<Button label="click me" label.over="over me" includeIn="up, over"/>
状态组
可以把一种或几种状态归类到状态组
<s:states>
<s:State name="A" stateGroups="G1,G2"/>
<s:State name="B" stateGroups="G2"/>
<s:State name="C" stateGroups="G1"/>
<s:State name="D" stateGroups="G1"/>
</s:states>
<s:Button label.G1="SomeLabel"/>
<s:Button includeIn="G1"/>
<s:Button label.G2="SomeLabel"/>
<s:Button includeIn="G2"/>
mx.states.Transition 定义了一个效果集合,这个集合用来在状态间转换时使用。下面就定义当任何状态往B状态迁移时,都会执行这个Transition里的effect,在场景切换时就是影藏掉当前场景,切换出等待场景,等目标场景载入后在影藏掉等待场景。
<mx:Transition id="myTransition" fromState="*" toState="B"> <mx:Parallel> ... </mx:Parallel> </mx:Transition>
http://opensource.adobe.com/wiki/display/flexsdk/Enhanced+States+Syntax