Opening a URL from Flash using navigateToURL (AS3)

Nebula picture Nebula · Jan 10, 2012 · Viewed 25.2k times · Source

Been pulling my hair out for hours today over this. I can't open another website from my already opened flash site.

Here is the code:

GotoFB.addEventListener(MouseEvent.CLICK, gotoFB);

function gotoFB(event:MouseEvent):void
{

    navigateToURL(new URLRequest("http://www.facebook.com"), "_blank");
}

This works from the flash player but not from chrome/ie/firefox..

Answer

Niels Bosma picture Niels Bosma · Sep 11, 2013

Had some problems with navigateToUrl in recent chrome-update in my Flex-app. Had to use this workaround:

ExternalInterface.call("window.open", url, target);