flash actionscript:
Hi, I have problem making ExternalInterface.call() method work. I use Flash Pro
8 and .net 2 (COM Shockwave flash object) on Windows Form. I've based my app on
"IntrovertIM_CSharp" sample, so I use ExternalInterfaceProxy.dll to manage
calls.
Actionscript and c# code are at bottom.
My c# calls to actionscript (proxy.Call) work fine, but my actionscript calls
to c# are not executed. "proxy_ExternalInterfaceCall" never gets executed.
Oh, yes, and if I leave "if(ExternalInterface.available)" check, I get app.
exception, so app works only if I remove that check (partially though).
Can anyone help on this?
ACTIONSCRIPT:
import flash.external.*;
if(ExternalInterface.available)
{
ExternalInterface.addCallback("testFuntion", null, testFuntion);
function testFuntion(txt:String):Void
{
txtTest.htmlText = txt;
}
ExternalInterface.call("someCall", "something");
}
C#:
...
proxy = new ExternalInterfaceProxy(axShockwaveFlashControl);
proxy.ExternalInterfaceCall += new
ExternalInterfaceCallEventHandler(proxy_ExternalInterfaceCall);
proxy.Call("testFuntion", "test");
...
private object proxy_ExternalInterfaceCall(object sender,
ExternalInterfaceCallEventArgs e)
{
MessageBox.Show(e.FunctionCall.FunctionName); // does not
execute!!!
switch (e.FunctionCall.FunctionName)
{
case "someCall":
MessageBox.Show((string)e.FunctionCall.Arguments[0]);
return null;
default:
return null;
}
}