5

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..

iND
  • 2,663
  • 1
  • 16
  • 36
Nebula
  • 679
  • 2
  • 17
  • 37
  • What you mean you can't open it? Do you have any error message? – Sr.Richie Jan 10 '12 at 15:41
  • It works _PERFECTLY_ from a browser too. Also what @Sr.Richie said – Pranav Hosangadi Jan 10 '12 at 16:27
  • Please don't sign your posts. ([faq](http://stackoverflow.com/faq#signatures)) – iND Jan 10 '12 at 19:52
  • Can you get a link to the same site the Flash is on to work? What addons / plugins do you have in your browser? What does your html look like? Can you get it to work on someone else's computer? – Mar Jan 10 '12 at 22:20

3 Answers3

6

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

ExternalInterface.call("window.open", url, target);
Niels Bosma
  • 11,758
  • 29
  • 89
  • 148
0

File->Publish Settings->Local playback security->Access network only

Voila...

Smolniy
  • 456
  • 3
  • 9
0

Some popup blockers blocks navigateToURL(..., "_blank"), there is a bunch of workarounds of varying quality out there, mainly involving calling JavaScript's window.open via ExternalInterface instead of using navigateToURL(..., "_blank"). If you google for it, you may find one that works in your case.

Lars Blåsjö
  • 6,118
  • 2
  • 19
  • 23