`

Flex与Javascript互相通信(转)

    博客分类:
  • Flex
阅读更多

在Flex中有这么一个类:ExternalInterface.在这个类中它给我们:call和addCallback

 

Flex中As调用Js的方法是:    

1、导入包 (import flash.external.ExternalInterface;)

2、使用ExternalInterface.call("Js函数名称",参数)进行调用,其返回的值就是Js函数所返回的值

 

Js调用As的方法是: 1、导入包 (import flash.external.ExternalInterface;) 2、在initApp中使用ExternalInterface.addCallback("用于Js调用的函数名",As中的函数名)进行注册下 3、js中 就可以用document.getElementById("Flas在Html中的ID").注册时设置的函数名(参数)进行调用. ......

 

http://www.ej38.com/showinfo/javascript-flex-147590.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics