1 Reply Latest reply on Aug 10, 2010 3:47 AM by MissCellaneous2

    ExternalInterface.addCallback broken?

    flfx
      Hi,

      I'm still pretty new to actionscript, but there seems to be something up with Flash 9,0,28,0 and ExternalInterface.addCallback.

      Given this html:

      quote:



      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

      <html>
      <head>
      <title>Example 2</title>
      <script language="JavaScript">
      var flash;

      window.onload = function() {
      if(navigator.appName.indexOf("Microsoft") != -1) {
      flash = window.flashObject;
      }else {
      flash = window.document.flashObject
      }
      }

      function displayFlashInfo() {
      var flashInfo = flash.getFlashInfo();
      for(var key in flashInfo) {
      flashForm.flashInfoDisplay.value += key + ": " + flashInfo[key] + "\n";
      }
      }
      </script>
      </head>

      <body>

      <form name="flashForm">
      <textarea name="flashInfoDisplay" style="width:390px;height:300px;"></textarea>
      <input type="Button" value="Get Flash Info" name="flashInfoButton" onclick="javascript:displayFlashInfo();" style="width:100px;" />
      </form>

      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100" height="100" id="flashObject" align="middle">
      <param name="allowScriptAccess" value="sameDomain" />
      <param name="movie" value="Example2.swf" />
      <param name="quality" value="high" />
      <param name="bgcolor" value="#ffffff" />
      <embed src="Example2.swf" quality="high" bgcolor="#ffffff" width="1" height="1" name="flashObject" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />
      </object>

      </body>
      </html>




      and a simple flash file with this actionscript in the first frame:

      quote:



      import flash.external.ExternalInterface;


      ExternalInterface.addCallback("getFlashInfo", this, getFlashInfo);

      function getFlashInfo():Object {
      return System.capabilities;
      }





      I get an "Unspecified Error" on line 48 when I press the "get flash info" button in IE6. The MS Script Editor shows that line 48 is in the javascript emitted by flash:

      quote:


      function __flash__addCallback(instance, name) {
      instance[name] = function () {
      return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" +
      __flash__argumentsToXML(arguments,0) + "</invoke>")); //ERROR HERE

      }
      }




      ExternalInterface.call(...) seems to work fine.

      Anyone else having this problem? I'm using Flash Player 9,0,28,0 and Flash Pro 8.

      BTW, finding a simple "submit bug" link on the adobe site is so hard that I've given up. If someone could link me one, I'd appreciate it.
        • 1. Re: ExternalInterface.addCallback broken?
          MissCellaneous2

          I'm having a similar issue to the OP (albeit an old post!), specifically:

           

          __flash__addCallback(variable, "sendData");

           

          Where 'variable' is undefined - but only in flash versions less than 9.0.115, in my case the problem presents itself with version 9.0.47.

           

          I'd like to dig this up as I can find little else on the subject apart from the fact that it is fixed in flash player 9.0.115 and up.

           

          Whilst I have proven that to be the case, I need to know if I can fix this somehow for users that do have v9 earlier players (which I have no control over) without forcing them to have 9.0.115+, or if this is a bug that I have to 'live' with if users happen to have the early affected versions.

           

          Help? :/