addCallback(ExternalInterface.addCallback 方法)
public static addCallback(methodName:String, instance:Object, method:Function) : Boolean
将 ActionScript 方法注册为可从容器调用。成功调用
addCallBack()
后,容器中的 JavaScript 或 ActiveX 代码可以调用在 Flash Player 中注册的函数。可用性:ActionScript 1.0;Flash Player 8
参数
methodName
:String
- 从 JavaScript 调用 ActionScript 函数时可使用的名称。此名称不必与 ActionScript 方法的实际名称匹配。instance:Object
-this
在该方法中被解析成的对象。此对象不一定是在其上可找到该方法的对象,您可以指定任何对象(或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 调用的 ActionScript 方法。
ExternalInterface.addCallback(‘callFlash‘, a, function(t:String){this.s(t);});
ExternalInterface.addCallback(‘callFlash‘, null, function(t:String){a.s(t);});
联系客服