Hi
I am having a problem when I add components with the use of addChild
when switching states, and that is that the component's ID is not what
I specify in the code.
It is the VBox that I scpecify should have an id = "vbAdvanced", but
when I iterate over the children of pState when switched states, it
has an id created by Flex with the name of for ex VBox124.
How do I get around this, I need to be able to reach the added child
by id?
<mx:states>
<mx:State name="Advanced" id="idState">
<mx:AddChild relativeTo="{pState}" position="lastChild" id="tull">
<mx:VBox x="20" y="160" height="80" id="vbAdvanced" width="160">
<mx:CheckBox label="Regular expression" id="cbReg"/>
</mx:VBox>
</mx:AddChild>
<mx:SetEventHandler target="{lbAdvanced}" name="click
handler="currentState=''"/>
</mx:State>
</mx:states>
<mx:transitions>
<mx:Transition id="myTransision" fromState="*" toState="Advanced">
<mx:Parallel target="{vbAdvanced}">
<mx:WipeDown duration="2000"/>
<mx:Dissolve alphaFrom="0.0" alphaTo="1.0" duration="2000"/>
</mx:Parallel>
</mx:Transition>
</mx:transitions>
<mx:Panel x="382" y="263" width="300" height="400" layout="absolute"
id="pState">
<mx:Label x="20" y="70" text="Search"/>
<mx:TextInput x="20" y="90"/>
<mx:Button x="185" y="90" label="Go" id="bGo"/>
<mx:LinkButton x="20" y="120" label="Advanced Options"
id="lbAdvanced" click="currentState='Advanced'"/>
</mx:Panel>