Mega Code Archive

 
Categories / Flex / Components
 

Use radio button to change state

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"    backgroundColor="#eeeeee" layout="absolute">   <mx:states>     <mx:State name="oneway">       <mx:RemoveChild target="{label1}"/>       <mx:RemoveChild target="{departDate}"/>     </mx:State>   </mx:states>   <mx:Panel title="Select travel dates" layout="absolute" width="421" height="246" id="panel1" x="34" y="55"     headerHeight="75" borderAlpha="1" >     <mx:DateField x="61" y="57" id="returnDate"/>     <mx:Label x="10" y="59" text="Depart:"/>     <mx:Label x="183" y="59" text="Return:" id="label1"/>     <mx:DateField x="239" y="57" id="departDate"/>     <mx:ControlBar>       <mx:RadioButtonGroup id="typeGroup"/>       <mx:RadioButton label="Round Trip" selected="true" click="currentState=''"/>       <mx:RadioButton label="One Way" click="currentState='oneway'"/>       <mx:Spacer width="100%"/>       <mx:Button label="Search"/>     </mx:ControlBar>   </mx:Panel>    </mx:Application>