6 Replies Latest reply on Jan 18, 2010 11:52 PM by kevin-rubin

    ExternalInterface.call() in Internet Explorer 6

    kevin-rubin

      I'm having some difficulty using the ExternalInterface.call() in Internet Explorer.  Nothing happens...

       

      For my application I simply want to let the user press a button in my Flex application and then open a separate browser window with contents from a web server.  In Firefox and Chrome it works, the window pops up with the expected contents, but in IE nothing actually happens.  The button changes to the "pressed" colour, but no window pops up, and no error.

       

      My MXML looks like this:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
          <mx:Script>
              <![CDATA[
                  import mx.controls.Alert;
                  import flash.external.*;
                  private var urlToOpen : String = "http://www.adobe.com/products/flex/";
                  private function onViewPopupButtonClick() : void {
                      if (ExternalInterface.available) {
                          ExternalInterface.call("popupBrowserWindow", urlTextBox.text);
                      } else {
                          Alert.show("Cannot Access ExternalInterface!");
                      }
                  }
              ]]>
          </mx:Script>
          <mx:HBox>
              <mx:TextInput id="urlTextBox" text="{urlToOpen}" />
              <mx:Button id="popupButton" label="Pop Up" click="onViewPopupButtonClick()"/>
          </mx:HBox>
      </mx:Application>

       

      While my HTML file that loads the flex application looks like this:

      <html lang="en">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title></title>
      <script src="AC_OETags.js" language="javascript"></script>
      <style>
      body { margin: 0px; overflow:hidden }
      </style>
      </head>
      <body scroll="no">
      <script language="JavaScript" type="text/javascript">
      function popupBrowserWindow(url) {
           var options = "top=10,left=10,height=682,width=800,menubar=yes,location=no,resizable=no,status=yes,scro llbars=yes";
         mosWindow = window.open("", "Your Product", options);
           mosWindow.location.href = url;
           mosWindow.focus();
           return false;
      }
      </script>
      <script language="JavaScript" type="text/javascript">
          AC_FL_RunContent(
                  "src", "JSPopup",
                  "width", "100%",
                  "height", "100%",
                  "align", "middle",
                  "id", "JSPopup",
                  "quality", "high",
                  "bgcolor", "#869ca7",
                  "name", "JSPopup",
                  "allowScriptAccess","always",
                  "type", "application/x-shockwave-flash"
          );
      </script>
      <noscript>
          <h2> In the &lt;noscript&gt; section </h2>
            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                  id="JSPopup" width="100%" height="100%" allowScriptAccess="always"
                  codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                  <param name="movie" value="JSPopup.swf" />
                  <param name="quality" value="high" />
                  <param name="bgcolor" value="#869ca7" />
                  <param name="allowScriptAccess" value="always" />
                  <embed src="JSPopup.swf" quality="high" bgcolor="#869ca7"
                      width="100%" height="100%" name="App" align="middle"
                      play="true"
                      loop="false"
                      quality="high"
                      allowScriptAccess="always"
                      type="application/x-shockwave-flash"
                      pluginspage="http://www.adobe.com/go/getflashplayer">
                  </embed>
          </object>
      </noscript>
      </body>
      </html>

       

      If anyone has any ideas how to fix, or at least, continue troubleshooting it, I'd appreciate it.

       

      Thank you,

      Kevin