Ok, I have spent quite some time on this now and I am getting inclined towards the thinking that this might actually be a bug.I have a TabNavigator component in my code and I want to be able to run some code each time a particular tab is clicked. The obvious way to do that is add an event listener for the IndexChanged Event to the TabNavigator on the tabIndexChange property. Well, I did that and it doesn’t seem to work. I also tried the childIndexChange event listener and that didn’t work as well.

For demonstration purpose, I created this file which has event listeners for both tabIndexChange and childIndexChange. None of these seem to work.


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">

<mx:Script>

<![CDATA[
import mx.events.IndexChangedEvent;
import mx.controls.Alert;

private function onChildIndexChange(event:Event):void
{
Alert.show("here");
}
private function onTabIndexChange(event:Event):void
{
Alert.show("there");
}

]]>
</mx:Script>

<mx:TabNavigator id="tbNav" width="100%" childIndexChange="onChildIndexChange(event)"
tabIndexChange="onTabIndexChange(event)">
<mx:VBox label="Accounts" width="300" height="150">
</mx:VBox>
<mx:VBox label="Stocks" width="300" height="150">
</mx:VBox>
<mx:VBox label="Futures" width="300" height="150">
</mx:VBox>
</mx:TabNavigator>

</mx:Application>

Anyone else face any similar situation?