1 Reply Latest reply on Feb 9, 2007 8:30 AM by Henry_Ping

    ATL Composite control hosting Flash ActiveX in IE

    Henry_Ping
      Hi,

      I have an ATL Composite control with Flash ActiveX object. The communication between Flash and ATL control is done through ExternalInterface.

      This all works fine in ActiveX Test container. However, when I host my ATL composite control in IE6.0, CallFunction keeps throwing com_error.

      I made FlashCall working after calling DisableLocalSecurity(), but I still have no luck with CallFunction after spending significant amount of time.

      Is this a known issue? Is it possible to get CallFunction working in IE? I feel this is probably related to special security treatment by Flash ActiveX in IE.

      There is also similar issue reported when hosting Flash ActiveX within Excel: http://www.actionscript.org/forums/showthread.php3?t=125859

      I'm excited to find out the support of ExternalInterface in ActionScript. But, I'm a bit disappointed after realizing CallFunction doesn't work when Flash ActiveX is hosted by my ATL Composite Control in IE.

      Please help.

      Thanks
      -->Henry
        • 1. Re: ATL Composite control hosting Flash ActiveX in IE
          Henry_Ping Level 1
          More info:

          - My test sample is a very simple Flash8 file, it has only one button with the following ActionScript:
          "
          System.security.allowDomain("*");

          import flash.external.ExternalInterface;
          var wasSuccessful:Boolean = ExternalInterface.addCallback("Flash_Hello", null, FlashHello);

          function FlashHello(message:String):Void
          {
          fscommand("HelloBack", "foo");
          }

          on(click)
          {
          if (ExternalInterface.available)
          {
          ExternalInterface.call("External_Hello", "bar");
          }
          }
          "

          2. The Flash file above is played locally, I have verified it has the "Local Trust" privilage and ExternalInterface.addCallback returns TRUE.

          3. When the button is clicked, my ATL container is able to receive the "FlashCall" event, but CallFunction with properly formated XML argument returns com_error, the CallFunction looks like this:
          "
          CallFunction("<invoke name=\"Flash_Hello\" returntype=\"xml\"><arguments><string>\"hello\"</string></arguments></invoke>");
          "

          4. The exact same CallFunction succeeds in my standalone test application, it only fails in IE6.0 and probably IE7.0 as well though I didn't verify.

          5. In addition, I wrapped my ATL container as Mozilla plugin and run it in FireFox, surprisingly, CallFunction succeeds. This leads me to believe that Flash ActiveX explicitly checks for IE and may tighten its security level which prevents the inbound communication to the ActionScript.

          Any help?

          Thanks
          -->Henry