Opening a URL from Flash with navigateToURL (AS3)

Today I pulled my hair for hours. I cannot open another site 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 a flash player, but not from chrome / ie / firefox ..

+6
source share
3 answers

There were problems with navigateToUrl in the last chrome update in my Flex application. Had to use this workaround:

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

Some blocking pop-ups block navigateToURL(..., "_blank") , there are a lot of workarounds of various quality, mainly related to calling JavaScript window.open via ExternalInterface instead of using navigateToURL(..., "_blank") . If you use Google for this, you may find one that works in your case.

0
source

File-> Publish Settings-> Local Playback Security-> Network Access Only

Voila ...

0
source

Source: https://habr.com/ru/post/905621/


All Articles