ArrayCollection as dataProvider for TabBar : TabBar « Container « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Container » TabBarScreenshots 
ArrayCollection as dataProvider for TabBar
ArrayCollection as dataProvider for TabBar
          

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        import mx.events.ItemClickEvent;
        import mx.controls.TabBar;
        import mx.collections.ArrayCollection;
        [Bindable]
        private var STATE_ARRAY:ArrayCollection = new ArrayCollection([
                                                    {label:"A", data:"AA"},
                                                    {label:"B", data:"BB"},
                                                    {label:"C", data:"CC"}
                                                  ]);
        private function clickEvt(event:ItemClickEvent):void {
            var targetComp:TabBar = TabBar(event.currentTarget);
            forClick.text="label is: " + event.label + " index is: " + event.index + " capital is: " +
            targetComp.dataProvider[event.index].data;
        }
      
    </mx:Script>
    <mx:TabBar id="myTB" itemClick="clickEvt(event);">
        <mx:dataProvider>{STATE_ARRAY}</mx:dataProvider>
    </mx:TabBar>
    <mx:TextArea id="forClick" width="150" />
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1. defines the text for each tab in the TabBar control.<mx:String> defines the text for each tab in the TabBar control.
2.Use labelField property of TabBar control to specify the property name containing the tab textUse labelField property of TabBar control to specify the property name containing the tab text
3.itemClick event for TabBaritemClick event for TabBar
4.Spark TabBarSpark TabBar
5.TabBar ObjectTabBar Object
6.TabBar LabelTabBar Label
7.Populate a TabBar control from a variablePopulate a TabBar control from a variable
8.A handler for the itemClick event for this TabBar controlA handler for the itemClick event for this TabBar control
www___.__j__a___v__a_2__s_.___c___o___m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.