<?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.controls.Alert;
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="ButtonBar Control Example" height="75%" width="75%"
paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
color="0xffffff" borderAlpha="0.15" x="10" y="10">
<mx:Label width="100%" color="0x000000"
text="Select a button in the ButtonBar control."/>
<mx:TextArea id="myTA" width="100%" height="100%" color="0x000000"/>
<mx:ButtonBar itemClick="clickHandler(event);" color="0x000000">
<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:ButtonBar>
</mx:Panel>
</mx:Application>
No comments:
Post a Comment