1 Reply Latest reply on Apr 19, 2007 7:20 AM by dolinja

    Adding tabs dynamically at runtime for a tab navigator control

    rajeeva_nagaraj Level 1
      Hi,

      Is it possible in flex builder 2 to dynamically add the tabs at runtime to the tab navigator control, if we can add plz tell the procedure to do that

      thanks in advance

        • 1. Re: Adding tabs dynamically at runtime for a tab navigator control
          dolinja Level 1
          Given that you had a tab navigator declared in mxml like this:
          <mx:TabNavigator id="myTabber" selectedIndex="0">
          ...
          </mx:TabNavigator>

          you should just be able to call the addChild method, passing the child tab containers. So for example, in some ActionScript event handler:

          var newTab:Canvas = new Canvas();
          myTabber.addChild(newTab);

          bear in mind I haven't done this by adding tabs, but have done tons with adding controls to an application at runtime using this method (DataGrids, Grid, GridItems, etc...)

          Jason