js调用flash的方法时报错:Error calling method on NPObject!

如题;

uncaught exception: Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.]

默认actionscript中不允许向将方法注册到不同域的 html文档中, 对于这个我们只需要在as中加一下代码即可解决:
import flash.system.Security;
Security.allowDomain("*");
Security.allowInsecureDomain("*");

你可能感兴趣的:(Flash)