开发者

I can send variables from flash to javascript, but unable to do the opposite

开发者 https://www.devze.com 2023-01-10 16:07 出处:网络
I have this in AS3 var myName:String = \"David\"; 开发者_运维百科var result:Number = ExternalInterface.call(\"methodInJS\", myName);

I have this in AS3

var myName:String = "David";
开发者_运维百科var result:Number = ExternalInterface.call("methodInJS", myName);
trace("Result from JS call is: "+result);

And in javascript

function methodInJS(name) {
alert("Hello to " + name);
 return 17;
}

This allows me to send to javascript. What is the method to do the opposite. I want to send to flash.

SOLUTION: Looks like the addCallback works.

Thanks


I think you need to create an asynchronous call handler in Flex and then call that from JavaScript. See the docs here http://livedocs.adobe.com/flex/3/html/help.html?content=passingarguments_4.html

0

精彩评论

暂无评论...
验证码 换一张
取 消