Actionscript 3 ExternalInterface是否支持点表示法访问对象拥有的函数?

Actionscript 3 ExternalInterface是否支持点表示法访问对象拥有的函数?,actionscript-3,flash,Actionscript 3,Flash,extensalinterface.call是否支持对函数的点访问 我试图编写一个包装器类,但没有将所有函数都放在窗口文档中,因此我将它们放在自己的类MyClass.MyFunction中 但这是否适用于外部接口?这是否有效: var result:Object = ExtenalInterface.call("MyClass.MyFunction", "hello"); 从 要在容器中调用的函数的字母数字名称。使用非字母数字函数名会导致运行时错误(错误2155)。您可以使用try..catc

extensalinterface.call是否支持对函数的点访问

我试图编写一个包装器类,但没有将所有函数都放在窗口文档中,因此我将它们放在自己的类MyClass.MyFunction中

但这是否适用于外部接口?这是否有效:

var result:Object = ExtenalInterface.call("MyClass.MyFunction", "hello");

要在容器中调用的函数的字母数字名称。使用非字母数字函数名会导致运行时错误(错误2155)。您可以使用try..catch块来处理错误

您需要一个dispatcher函数来将内容引用到类:

function dispatcher() {
    var name = arguments[0];
    var func = MyClass[name];

    func.apply(null, arguments);
    //You may also wish to consider slicing the array to remove the function name before calling the function
}
并从AS3中这样使用它:

var result:Object = ExtenalInterface.call("dispatcher", "MyFunction", "hello");

谢谢,我想我的问题不清楚。很抱歉但我想我能解决我遇到的另一个问题。我将发布我所描述的内容以及我在回答中发现的内容+谢谢。