外部接口。 addcallback 在本地工作,但在服务器上不起作用?
对ExternalInterface.addcallback 的问题感到困惑。
主要是因为当我在浏览器中测试时,它始终在本地工作,但是当我部署到服务器时,它就停止工作了。
我添加了跟踪命令并确认在添加回调之前ExternalInterface 实际上可用,并且javascript 方法中的警报命令正确识别了flash 对象。 我还检查了allowscriptaccess 设置为“始终”。
这是否与远程服务器上提供的闪存有关?
真的很难过
Confused by a problem with ExternalInterface.addcallback.
Mainly because I have it ALWAYS working locally, when I test in a browser, but the moment I deploy to a server it stops working.
I've added trace commands and confirmed that ExternalInterface is in fact available before adding the callback, and an alert command in the javascript method correctly identifies the flash object.
I also checked and allowscriptaccess is set to 'always'.
Could it have something to do with the flash being served on a remote server?
really stumped
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试添加 System.security.allowDomain("*"); (或者实际填写正确的域而不是 *)。给你的AS。
您已经拥有allowscriptaccess。还要确保 swf 和 html/js 来自同一主机......而不是 www.foobar.com 和 foobar.com 另一个,有时会出错。
Try adding System.security.allowDomain("*"); (or actually filling out the correct domain instead of *). To your AS.
You already have allowscriptaccess. Also make sure the swf and the html/js are coming from the same host.... not www.foobar.com and foobar.com for the other, sometimes that will getcha.