2 Replies Latest reply on Jul 18, 2011 3:50 AM by kokorito

    How to open URL in a new tab? NOT in new window!

    ananduthamans

      Dear All,

       

      I am a newbie to Flex and this is my first application here. Kindly forgive me for the ignorance.

       

      I have a tabbed pane created using ViewStack. When the user click a button on the first tab, an external URL has to be invoked in a new tab. I have written this function which successfully creates the new tab but when I try to open the URL using navigateToURL it opens in a new window:( What I need is to open the URL in the newly created tab. I have tried out navigateToURL parameters such as _self, _blank, top etc but none seems to work out. Could anyone kindly let me know the standard way to do this? is it ExternalInterface or ModuleLoader or something else? Please give me some references that would help me do it. I am trying this for quite some time now but no luck . Thanks a million in advance.


      protected function button2_clickHandler(event:MouseEvent):void

      {

          var newVBox:VBox = new VBox();
          var newLabel:Label = new Label();
          newLabel.text = "Hotspot Mngmt panel";
          newVBox.label = "Hotspot Mngmt";
         
          /* navigateToURL( new URLRequest( "http://ipmsit.tsmc.com.tw/Hotspot/Hotspot/index.html" ), "_self" );*/ --opens in same window, not new tab.

         
          var my_loader:Loader = new Loader();
          my_loader.load(new URLRequest("http://ipmsit.tsmc.com.tw/Hotspot/Hotspot/index.html"));
          newVBox.addChild(my_loader.content as DisplayObject); - throws exception
          
           vs.addChild(newVBox); -- "vs" is the id of the ViewStack

      }

       

      Warm Regards

      Anand Uthaman