title: TabbedViewNavigator from Actionscript
body: <p>How can I instantiate a TabViewNavigator from actionscript for the playbook? Currently, I add the necessary spark frameworks and have this piece of code in the Main of my actionscript project:</p>
  
  <pre><code>[SWF(width="1024", height="600", backgroundColor="#ffffff", frameRate="30")]
  public class Main extends Sprite
  {
      private var waitDialog:BaseDialog = new BaseDialog ();
  
      public function Main()
      {
          super ();
          var next:LabelButton = new LabelButton ();
          next.label = "Next";
          next.addEventListener(MouseEvent.CLICK,showTabs);
          this.addChild(next);
      }
  
      private function showTabs (event:MouseEvent):void{
          var temp:Stage = this.stage;
          temp.removeChild(this);
          var bar : TabbedViewNavigator = new TabbedViewNavigator();
          var tab1:ViewNavigator = new ViewNavigator();
          tab1.label = "Test";
          bar.addItem(tab1);
          temp.addChild(bar);
      }
  }
  </code></pre>
  
  <p>When the button is clicked, the button disappears as you would expect but the tab navigator is not added/does not appear. I tried without removing the <code>Main</code> class but that does not work either. What do I need to do to set up a tab interface. I can get similar code working through Flex and MXML but not in actionscript.</p>