Monday, November 14, 2011

Flex: Disable button in Togglebuttonbar

say, you defined your toggle button bar as below

<mx:ToggleButtonBar id="tbbModule" itemClick="tbbModule_Click(event)">
          <mx:Array>
          <mx:String>Home</mx:String>
          <mx:String>Module 1</mx:String>
          <mx:String>Module 2</mx:String>
          </mx:Array>
      </mx:ToggleButtonBar>

If you want to disable the first button, then


mx.controls.Button(tbbModule.getChildAt(0)).enabled =false;