I think you can achieve the behavior you're looking for if you bind your
method to the change event instead of the click event:

<mx:TabNavigator change="whichTab()" click="" id="tn"  width="100%"
height="100%">

Seth Lemoine


On 1/10/08, Robert Capilli <[EMAIL PROTECTED]> wrote:
>
>  I am trying to get the SelectedIndex of the tab that I have clicked on.
>
>
>
> When I click on the tab, my Method is NOT ran…
>
> If I click WITHIN the tab I get the method to run..
>
>
>
> But I want my method to run when I click on the TAB itself.. What am I
> doing wrong here?
>
> * *
>
> *Complete Code Below:*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> <?xml version="1.0"?>
>
> <!-- Simple example to demonstrate the TabNavigator layout container. -->
>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
>
>
>
> <mx:Script>
>
>             <![CDATA[
>
>                         public function whichTab():void{
>
>                                     trace(tn.selectedIndex);
>
>                         }
>
>             ]]>
>
> </mx:Script>
>
>     <mx:Panel title="TabNavigator Container Example" height="90%"
> width="90%"
>
>         paddingTop="10" paddingLeft="10" paddingRight="10"
> paddingBottom="10">
>
>
>
>         <mx:Label width="100%" color="blue"
>
>             text="Select the tabs to change the panel."/>
>
>
>
>         <mx:TabNavigator click="whichTab()" id="tn"  width="100%"
> height="100%">
>
>             <!-- Define each panel using a VBox container. -->
>
>
>
>             <mx:VBox label="Panel 1">
>
>                 <mx:Label text="TabNavigator container panel 1"/>
>
>             </mx:VBox>
>
>
>
>             <mx:VBox label="Panel 2">
>
>                 <mx:Label text="TabNavigator container panel 2"/>
>
>             </mx:VBox>
>
>
>
>             <mx:VBox label="Panel 3">
>
>                 <mx:Label text="TabNavigator container panel 3"/>
>
>             </mx:VBox>
>
>         </mx:TabNavigator>
>
>
>
>         <mx:Label width="100%" color="blue"
>
>             text="Programmatically select the panel using a Button
> control."/>
>
>
>
>         <mx:HBox>
>
>             <mx:Button label="Select Tab 1" click="tn.selectedIndex=0"/>
>
>             <mx:Button label="Select Tab 2" click="tn.selectedIndex=1"/>
>
>             <mx:Button label="Select Tab 3" click="tn.selectedIndex=2"/>
>
>         </mx:HBox>
>
>
>
>     </mx:Panel>
>
> </mx:Application>
>
>
>
>
>
> Rob Capilli | Product Development | EyeWonder
> Phone 678.891.2247 | Mobile 404.273.6273 | Fax 678.891.2017
> [EMAIL PROTECTED] | aim - rcapilli
>
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------



-------------------------------------------------------------

To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line



For more info, see http://www.affug.com

Archive @ http://www.mail-archive.com/discussion%40affug.com/

List hosted by http://www.fusionlink.com

-------------------------------------------------------------

Reply via email to