flex中tabBar

发布时间:2009-05-19 16:26:00 阅读:1206次

tabBar.mxml

<?xml version="1.0" encoding="utf-8"?> 
<!--http://www.javaeye.com/topic/210348-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> 
    <mx:Style source="style.css"/> 
    <mx:Script> 
        <![CDATA[             
            import mx.events.ItemClickEvent;         
            internal function btn_click_handler(evt:ItemClickEvent):void{ 
                myViewstack.selectedIndex = evt.index; 
            } 
        ]]> 
    </mx:Script> 
    <mx:Panel x="43" y="10" width="366" height="310" layout="absolute" horizontalGap="0" verticalGap="0" title="TabBar实例" borderStyle="solid"> 
    <mx:TabBar id="btns" x="10" y="10" width="308" itemClick="btn_click_handler(event)"> 
        <mx:dataProvider> 
            <mx:Array> 
                <mx:String>Flex</mx:String> 
                <mx:String>Flash</mx:String> 
                <mx:String>FMS</mx:String> 
                <mx:String>FDS</mx:String> 
            </mx:Array> 
        </mx:dataProvider>
    </mx:TabBar> 
    <mx:ViewStack x="10" y="40" id="myViewstack" width="308" height="200"> 
        <mx:Canvas id="child1" label="View 1" width="100%" height="100%"> 
            <mx:List> 
                <mx:Array> 
                    <mx:Object label="请选择您感兴趣的技术:"/>                    
                    <mx:Object label="Flash"/> 
                    <mx:Object label="Flex"/> 
                    <mx:Object label="Flash Media server"/> 
                    <mx:Object label="Breeze"/> 
                </mx:Array> 
            </mx:List> 
        </mx:Canvas> 
        <mx:Canvas id="child2" label="View 2" width="100%" height="100%"> 
            <mx:TextInput text="请输入您的邮箱地址" /> 
            <mx:Button x="168" y="1" label="订阅Flash Rss"/> 
        </mx:Canvas> 
        <mx:Canvas id="child3" label="View 3" width="100%" height="100%"> 
            <mx:Label text="FMS 2.0.4发布了" /> 
        </mx:Canvas> 
        <mx:Canvas id="child4" label="View 4" width="100%" height="100%"> 
            <mx:Label text="Breeze" /> 
        </mx:Canvas> 
    </mx:ViewStack> 
    </mx:Panel> 
</mx:Application>

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询
上一篇:toggleButtonbar
下一篇:flex中menuBar

转载请注明:flex中tabBar 出自老鄢博客 | 欢迎分享