ButtonBar 的使用
代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
import mx.controls.Alert;
[Bindable]
[Embed("png/Calendar_scheduleHS.png")]
private var icon1:Class;
private function itemClick(evt:ItemClickEvent):void{
Alert.show(evt.label.toString());
}
]]>
</mx:Script>
<mx:Array id="_Bar">
<mx:Object label="按钮1" icon="{icon1}"/>
<mx:Object label="按钮2"/>
<mx:Object label="按钮3"/>
</mx:Array>
<mx:ButtonBar x="61" y="82" dataProvider="{_Bar}" itemClick="itemClick(event);">
</mx:ButtonBar>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
import mx.controls.Alert;
[Bindable]
[Embed("png/Calendar_scheduleHS.png")]
private var icon1:Class;
private function itemClick(evt:ItemClickEvent):void{
Alert.show(evt.label.toString());
}
]]>
</mx:Script>
<mx:Array id="_Bar">
<mx:Object label="按钮1" icon="{icon1}"/>
<mx:Object label="按钮2"/>
<mx:Object label="按钮3"/>
</mx:Array>
<mx:ButtonBar x="61" y="82" dataProvider="{_Bar}" itemClick="itemClick(event);">
</mx:ButtonBar>
</mx:Application>