首页» FLEX »FLEX例子之按钮条(ButtonBar)

FLEX例子之按钮条(ButtonBar)

立即注册PayPal并开始接受信用卡付款。
转载请保持文章完整性!
本文链接地址:http://blog.desizen.com/4lone/420.html
主页:joel's blog

这个例子进行的是UI Controls:Buttons:
简介:
The control defines a horizontal or vertical group of logically related push buttons with a common look and navigation.
例子:

<?xml version="1.0"?>
<!-- Simple example to demonstrate the ButtonBar control. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundGradientColors="[0x000000,0x323232]" viewSourceURL="srcview/index.html">
 
    <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="ButtonBar Control Example" height="75%" width="75%"
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
        color="0xffffff" borderAlpha="0.15">
 
       <mx:Label width="100%" color="0x000000"
           text="Select a button in the ButtonBar control."/>
 
        <mx:TextArea id="myTA" width="100%" height="100%" color="0x000000"/>
<!--给ButtonBar添加itemClick事件-->
        <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>

标签:, , ,

与"FLEX例子之按钮条(ButtonBar)"相关的文章:

评论暂缺 »

还没有任何评论。

留下评论

emoticons

Feedback Form