0 Replies Latest reply on Aug 5, 2014 2:47 PM by ssolon

    Using ExternalInterface to open a browser window whose body is set by document.write is not working in Firefox 31

    ssolon

      Using ExternalInterface to open a new browser window is not working in Firefox 31 although it works in previous versions and most other browsers.

       

      Has anybody else encountered this or have any ideas?

      <?xml version="1.0"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">

       

          <fx:Script>

              <![CDATA[

              import mx.controls.Alert;

              private var _w:*;

       

       

              public function openWindow():void {

                  ExternalInterface.call("function() { "

                      + " var w = window.open('', 'Test Window','height=120, width=500, scrollbars=no, status=no, location=no, fullscreen=no, titlebar=no, toolbar=no');"

                      + " if (!w) {"

                      + "     alert('w is null!!!!!!!');"

                      + " }"

                      + " var body='<html><head><title>Test Window</title></head><body><h1>Testing</h1>This is from Flex</body></html>';"

                      + " w.document.open();"

                      + " w.document.write(body);"

                      + " w.document.close(); "

                      + " alert('Starting...' + body);"

                      + "}");

              }

              ]]></fx:Script>

          <s:VGroup paddingTop="10" paddingLeft="10" paddingBottom="10" paddingRight="10">

              <s:Label text="Test opening a window using ExternalInterface."/>

              <s:Button click="openWindow()" label="Open Window"/>

          </s:VGroup>

      </s:Application>