There's an event called the "FlexEvent.SHOW" event which should work for you. See: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/events/FlexEvent.html#SHOW
You can put this on the TabNavigator. i.e.
<mx:TabNavigator>
<comp:SomeComp show="doSomething()" label="My Tab"/>
</mx:TabNavigator>
Or you can put it inside your component. i.e.
<mx:Canvas show="doSomething">
<!-- My Component-->
</mx:Canvas>
If you're creation policy is set, you can also do this on creationComplete, but it will only happen the FIRST time the tab is created.
Running example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" minWidth="955" minHeight="600">
<mx:TextArea id="log" width="100%" height="500">
</mx:TextArea>
<mx:TabNavigator width="500">
<mx:Canvas label="One" show="{log.text+='One Clicked\n';}"/>
<mx:Canvas label="Two" show="{log.text+='Two Clicked\n';}"/>
<mx:Canvas label="Three" show="{log.text+='Three Clicked\n';}"/>
<mx:Canvas label="Four" show="{log.text+='Four Clicked\n';}"/>
</mx:TabNavigator>
</mx:Application>
With dynamic tabs.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="cc()" layout="vertical" minWidth="955" minHeight="600">
<mx:TextArea id="log" width="100%" height="500">
</mx:TextArea>
<mx:Script>
<![CDATA[
import mx.containers.Canvas;
import mx.events.FlexEvent;
private function cc():void{
var canv:Canvas = new Canvas();
canv.label = "One";
canv.addEventListener(FlexEvent.SHOW,onShow);
tn.addChild(canv);
canv = new Canvas();
canv.label = "Two";
canv.addEventListener(FlexEvent.SHOW,onShow);
tn.addChild(canv);
}
private function onShow(event:Event):void{
log.text+=event.currentTarget.label+ " clicked\n";
}
]]>
</mx:Script>
<mx:TabNavigator id="tn" width="500">
</mx:TabNavigator>
</mx:Application>