Definition:
It defines a horizontal or vertical group of buttons, that maintain their selected or deselected state. Only one button in the ToggleButtonBar control can be in the selected state. You can use the ButtonBar control to define a group of push buttons.
ToggleButtonBar control has the following default characteristics:
Preferred Size
Control resizing rules
selectedIndex
Padding
Source Code:
<?xml version=”1.0″?>
<!– Simple example to demonstrate the ToggleButtonBar control. –>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml“>
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
// Event handler function to print a message
// describing the selected Button control.
private function clickHandler(event:ItemClickEvent):void {
myTA.text="Selected button index: " + String(event.index) +
"\n" + "Selected button label: " + event.label;
}
]]>
</mx:Script>
<mx:Panel title=”ToggleButtonBar Control Example” height=”75%” width=”75%”
paddingTop=”10″ paddingLeft=”10″ paddingRight=”10″ paddingBottom=”10″>
<mx:Label width=”100%” color=”blue”
text=”Select a button in the ToggleButtonBar control.”/>
<mx:TextArea id=”myTA” width=”100%” height=”100%”/>
<mx:ToggleButtonBar itemClick=”clickHandler(event);”>
<mx:dataProvider>
<mx:Array>
<mx:String>Flash</mx:String>
<mx:String>Director</mx:String>
<mx:String>Dreamweaver</mx:String>
<mx:String>ColdFusion</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ToggleButtonBar>
</mx:Panel>
</mx:Application>
Thanks with Regards,
Pandimalar A