addCallback(ExternalInterface.addCallback 方法)
public static addCallback(methodName:String, instance:Object, method:Function) : Boolean
將 ActionScript 方法注冊(cè)為可從容器調(diào)用。成功調(diào)用
addCallBack()
后,容器中的 JavaScript 或 ActiveX 代碼可以調(diào)用在 Flash Player 中注冊(cè)的函數(shù)。可用性:ActionScript 1.0;Flash Player 8
參數(shù)
methodName
:String
- 從 JavaScript 調(diào)用 ActionScript 函數(shù)時(shí)可使用的名稱(chēng)。此名稱(chēng)不必與 ActionScript 方法的實(shí)際名稱(chēng)匹配。instance:Object
-this
在該方法中被解析成的對(duì)象。此對(duì)象不一定是在其上可找到該方法的對(duì)象,您可以指定任何對(duì)象(或null
)。
instance:Object
- The object to whichthis
resolves in the method. This object is not necessarily the object on which the method can be found -- you can specify any object (ornull
).
method:Function
- 要從 JavaScript 調(diào)用的 ActionScript 方法。
ExternalInterface.addCallback(‘callFlash‘, a, function(t:String){this.s(t);});
ExternalInterface.addCallback(‘callFlash‘, null, function(t:String){a.s(t);});
聯(lián)系客服