Recently while working on an AIR app, I had to create some functionality when the user clicked on a different tab, therefore I wanted to simply check for the active tab using an event. Something that I have found was that as soon as you use a viewstack as a dataprovider no events will be sent. Which led me to the conclusion that it’s not possible to track which tab the user clicked.. UNTIL I came across the ItemClickEvent which was exactly the piece that I was searching for.
How to use the ItemClickEvent
import mx.events.ItemClickEvent; private function tabChange(e:ItemClickEvent):void{ trace(e.label); //outputs the label of the selected tab trace(e.item); //outputs the item in the dataprovider of the selected tab trace(e.index); // outputs the index of the selected navigation item }
and below the mxml tag for the tabbar component
<mx :TabBar id="navBar" x="10" y="125" dataProvider="viewstack1" themeColor="#648B9A" selectedIndex="0" itemClick="tabChange(event)"/>Actually pretty simple, but when reading throuh the docs, then you pretty quick think that it’s not possible.. although nothing is impossible

The Flex 3: Tabbar event by Tiago's Weblog, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 2.5 Switzerland License.



A nice work good keep it up