views:

44

answers:

2

All I need to open a new IE Window from within Flex code on click of a link.

P.S I dont want to open a new Browser. I want to open a browser window only that can open a new URL.

Something like clicking on a link in Flex and then open cnnibn.com in a Pop up window.

+1  A: 

One of the following methods will work unless the popup blocker blocks it.

  • Use navigateToURL

Add the following to the click handler of the button

navigateToURL(new URLRequest("cnnibn.com"), "_blank");
  • Use ExternalInterface

Add this line to click handler

ExternalInterface.call("openPopup", "cnnibn.com");

And the following to a script tag in the embedding html page

function openPopup(url)
{
    window.open(url, "_blank");
}
Amarghosh
+1  A: 

You should just be able to use:

navigateToURL(new URLRequest('http://www.cnnibn.com'), '_blank');

(make sure you import the relevant packages: "import flash.net.*")

This approach may have issues with some popup blockers, if so then you could have a look at the class here:

http://www.zorked.com/flash/flash-and-navigatetourl-popup-blocking/

vitch