1 Reply Latest reply on Nov 28, 2006 10:10 AM by michael_ramirez44

    RadioButton effects a combobox

    GeorgeWS Level 1
      I have 2 radio buttons and a combobox. I want the combobox to be disabled. When a user selects to second radioButton the combobox becomes enabled. Does anyone know how to do this? any samples. I can do it with another combobox just not a radioButton.
      Thanks
      George
        • 1. Re: RadioButton effects a combobox
          michael_ramirez44 Level 1
          <?xml version="1.0"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" >

          <mx:Script>
          <![CDATA[
          import mx.events.ItemClickEvent;

          private function handleEvent(event:ItemClickEvent):void {
          if (event.currentTarget.selectedValue == "Enable") {
          cmb.enabled = true;
          }
          else if (event.currentTarget.selectedValue == "Disable") {
          cmb.enabled = false;
          }


          }
          ]]>
          </mx:Script>
          <mx:HBox>
          <mx:RadioButtonGroup id="cmbRadio" itemClick="handleEvent(event);"/>
          <mx:RadioButton id="rbEnable" groupName="cmbRadio" label="Enable"/>
          <mx:RadioButton id="rbDisable" groupName="cmbRadio" label="Disable"/>
          <mx:ComboBox id="cmb"/>
          </mx:HBox>
          </mx:Application>