呼び出しExternalInterface.addCallback
後、私はする必要がありますか
ExternalInterface.addCallback("foo", null);
ExternalInterface.call
何度も使うので?
これが私の方法です
public static function javascript(jsFunctionYouWantCall:String, jsFunctionToBindResponse:String, onResponse:Function, jsFunctionYouWantCallParam:Object = null):Boolean
{
if (!ExternalInterface.available)
return false;
try
{
ExternalInterface.addCallback(jsFunctionToBindResponse, function response(param:Object):void
{
//ExternalInterface.addCallback(jsFunctionToBindResponse, null);
onResponse(param);
});
ExternalInterface.call(jsFunctionYouWantCall, jsFunctionYouWantCallParam);
}
catch(error:Error)
{
onResponse(error);
}
return true;
}