<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#874040, #874040]">
<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 {
tgPanel.title = "ToggleButtonBar: " + event.label;
myTA.text="Selected button index: " + String(event.index) +
"\n" + "Selected button label: " + event.label;
}
]]>
</mx:Script>
<mx:Panel id="tgPanel" title="ToggleButtonBar: Flash" layout="vertical" width="75%" color="0xffffff" borderAlpha="0.15"
paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center" x="10" y="10">
<mx:ToggleButtonBar color="0x323232" horizontalGap="5" itemClick="clickHandler(event);">
<mx:dataProvider>
<mx:Array>
<mx:String>Flash</mx:String>
<mx:String>Flex</mx:String>
<mx:String>AIR</mx:String>
<mx:String>ColdFusion</mx:String>
<mx:String>LiveCycle</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:ToggleButtonBar>
<mx:Label width="100%" textAlign="center" color="0x323232"
text="Select a button in the ToggleButtonBar control."/>
<mx:TextArea color="0x323232" id="myTA" width="100%" height="100%" text="{'Selected button index: 0' + '\n' +'Selected button label: Flash'}"/>
</mx:Panel>
</mx:Application>
No comments:
Post a Comment