2 Replies Latest reply on Sep 15, 2009 3:26 AM by michael nieuwenhuizen

    TabNavigator.getTabAt(index) gives "out of bounds" error

    michael nieuwenhuizen

      I wanna call a function when the user click on the Tab of my TabNavigator.  I was hoping to use the getTabAt(index) method as it returns a button that I can attach my function to.  If I try:

       

         var tabNav:TabNavigator = new TabNavigator();
                      
         var vbox0:VBox = new VBox();
         vbox0.label = "tab 0";
         tabNav.addChild(vbox0);

       

         this.addChild(tabNav);
                     
         var b:Button = tabNav.getTabAt(0);

       

      the last line gives me an error: "index out of bounds".  What am I doing wrong here?