1 Reply Latest reply on Jul 27, 2007 8:04 AM by frankmail007

    ExternalInterface with C#.NET ActiveX Container

    Howoong
      I want to transmit JPEG image data from C# to Flash SWF, in order to display in SWF.

      After I had written a JPEG data as a file on hard disk in C#,
      I sent the filepath to Flash SWF, by using AxShockwaveFlash like:

      xmlRequest =
      "<invoke name=\"DisplayJpeg\" returntype=\"xml\">" +
      "<arguments>" +
      "<string>C:\\temp\\thisimage.jpg</string>" +
      "</arguments>" +
      "</invoke>";

      xmlResponse = oAxShockwaveFlash.CallFunction (xmlRequest);


      And, in the Action Script file in Flash file, I used following code:

      import flash.external.ExternalInterface;
      ...
      ExternalInterface.addCallback ("DisplayJpeg", this, doDisplayJpeg);
      ...
      public function doDisplayJpeg (filePath:String):Void
      {
      aLoader.contentPath = filePath;
      ...
      }

      It works fine, but it takes longer time due to the disk write/read operations.

      Is there any way avoiding disk write/read to display JPEG image in the Flash SWF?

      Can I send binary data through AxShockwaveFlash CallFunction, from C# to Flash?
      Can I get the binary data in an ActionScript variable in Flash; and display it thru Loader, or other component?

      Thanks,
      Joseph