1

I am trying to open a browser window with a specific URL from within flash. The code below works on IE and FF but not Chrome. I see nothing happen and I see no output on chrome's javascript console. Any help would be appreciated

    private function newWin():void {

        var jscommand:String = "window.open('http://www.slashdot.org','win','height=200,width=300,toolbar=no,scrollbars=yes')";
        var urlX:URLRequest = new URLRequest("javascript:" + jscommand + ";");
        ExternalInterface.call("window.open","http://www.slashdot.org","win","height=200,width=300,toolbar=no,scrollbars=yes");

    }
    ]]></fx:Script>

     <s:Button label="Go to adobe.com 5"
               click="newWin()" />

2 Answers2

1

With your JS command, you have to change your embed/object HTML tag's "allowScriptAccess" attr to "always".

kvasirr
  • 154
  • 3
0

It may not be a Flash + Chrome issue, but rather a Javascript + Chrome one.

As suggested in this post, try putting 'about:blank' as the first param in your javascript, just to see if it opens:

window.open('about:blank','win' ...

This other post may give you some other ideas as well.

If all else fails you can still open a window using NavigateToURL()

navigateToURL(new URLRequest("http://www.slashdot.org"), "_blank");

This of course wouldn't give you your window sizing options, but at least you'd get a new window out of it.

Community
  • 1
  • 1
ToddBFisher
  • 11,370
  • 8
  • 38
  • 54