<?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"
viewSourceURL="srcview/index.html"
width="180" height="170">
<s:states>
<s:State name="s1" stateGroups="stateGroupA"/>
<s:State name="s2" stateGroups="stateGroupA"/>
<s:State name="s3" stateGroups="stateGroupB"/>
<s:State name="s4" stateGroups="stateGroupB"/>
</s:states>
<s:Button label="Next State" click="currentState =
(currentState == 's1') ? 's2' :
(currentState == 's2') ? 's3' :
(currentState == 's3') ? 's4' : 's1'"/>
<s:Label x="80" y="5" text="State: {currentState}"/>
<s:Button label="Button1" y="50" includeIn="stateGroupA"/>
<s:Button label="Button2" y="80" includeIn="stateGroupA"/>
<s:Button label="Button3" y="110" includeIn="stateGroupB"/>
<s:Button label="Button4" y="140" includeIn="stateGroupB"/>
</s:Application>