<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>
import mx.events.ItemClickEvent;
private function clickHandler(event:ItemClickEvent):void {
myTA.text= String(event.index) + "\n" + "Selected button label: " + event.label;
}
</mx:Script>
<mx:TextArea id="myTA" width="200" height="100"/>
<mx:ButtonBar horizontalGap="5" itemClick="clickHandler(event);">
<mx:dataProvider>
<mx:String>Flash</mx:String>
<mx:String>Director</mx:String>
<mx:String>Dreamweaver</mx:String>
<mx:String>ColdFusion</mx:String>
</mx:dataProvider>
</mx:ButtonBar>
</mx:Application>
|