Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting HRESULT E_FAIL when trying to call a method in AS3 from C#
    primarykey
    data
    text
    <p>I am getting the <code>HRESULT E_FAIL</code> error when trying to access a method in an AS3 .swf file, running as an AxShockwaveFlashObject component inside a Winform. The flash component can communicate with C# through Externalinterface just fine, but sendin from C# to Flash has been impossible so far.</p> <p>The error seems to be generic and meaningless, as I've found lots of unanswered questions. I will try nevertheless for this specific scenario:</p> <p><strong>C#</strong></p> <pre><code>String method = "&lt;invoke name=\"NewFilename\" returntype=\"xml\"&gt;&lt;/invoke&gt;&lt;arguments&gt;&lt;/arguments&gt;"; mainFlashControl.CallFunction(method); </code></pre> <p><strong>AS3</strong></p> <pre><code>public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); if (ExternalInterface.available) { ExternalInterface.addCallback("NewFilename", NewFilename); } } public function NewFilename():void { // Do Something... } </code></pre> <p>UPDATE: All I've <a href="http://forums.adobe.com/message/84670?tstart=0#84670" rel="nofollow">been able to find</a> is a workaround that checks every time interval for any function waiting to be called, by making a call (from AS3 to C#) and reading the response. However, I also can't get the response to return anything. I've used <code>flashComponent.setResponseValue("test");</code> and on the flash side the Externalinterface.Call() always returns null.</p> <p>UPDATE: I've also looked into FSCommand now, also works form AS3 to C# but there doesn't seem to be any way for me to attach a return value to it either...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload