菜单创建

 <mx:XMLList id="menubarXML" >
  <menuitem label="Menu1" data="top">
            <menuitem label="MenuItem 1-A" data="1A"/>
            <menuitem label="MenuItem 1-B" data="1B"/>
        </menuitem>

 

 

 private function addTab(label:String,data:String):void{
    var child:Container;
    switch(data){
     case "1A":
      child=tabMap.get("1A") as Container;
      if(child==null){
       child=new VBox();
       child.id="1A";
       child.label = label;
       child.icon = document_icon;
       mainVS.addChild(child);
       tabMap.put(child.id.toString(),child);
      }
      break;
  

private function closeTab(event:SuperTabEvent):void{
    var tabIndex:int=event.tabIndex;
    tabMap.remove(event.target.getChildAt(tabIndex).id.toString());
   }

 

 

 <mx:VBox width="100%" height="100%" >
   <mx:HBox width="100%" backgroundColor="#ACACAC" backgroundAlpha="0.5">
    <mx:MenuBar labelField="@label" dataProvider="{menuBarCollection}" itemClick="menuHandler(event);" width="100%" height="26"/>
    <mx:TextInput width="100%" maxWidth="200"/>
   </mx:HBox>
   
   <flexlib:SuperTabNavigator id="mainVS" scrollSpeed="25" dropShadowEnabled="true" paddingTop="5"
    stopScrollingEvent="{MouseEvent.MOUSE_UP}" startScrollingEvent="{MouseEvent.MOUSE_DOWN}"
    width="100%" height="100%" horizontalGap="0" closePolicy="{SuperTab.CLOSE_ROLLOVER}"
    creationComplete="{mainVS.setClosePolicyForTab(0, SuperTab.CLOSE_NEVER);}" tabClose="closeTab(event);">
    <mc:HomeConsole width="100%" height="100%" label="首页>
   </flexlib:SuperTabNavigator>
  </mx:VBox>

 

 

 private function initCollections():void {
                menuBarCollection = new XMLListCollection(menubarXML);
            }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值