LocalConnection 在本地浏览器中工作,但不在远程站点中工作
对 LocalConnection 的不稳定行为感到非常困惑。 使用使用 localConnection 工作的调试实用程序(LuminicBox)。
当包含 swf 的页面在本地浏览器中加载时,localConnection 就会起作用。
当在远程站点上“实时”查看相同的页面和 swf 时,localConnection 会失败。
有人遇到过这种情况吗??
Really puzzled by the flaky behavior of LocalConnection.
Using a debug utility(LuminicBox) that uses localConnection to work.
When the page containing the swf is loaded in a browser locally , localConnection works.
When the identical page and swf are viewed 'live' on a remote site, localConnection fails.
Anyone encounter this??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
默认情况下,LocalConnection 允许从同一域加载的 swf 之间进行通信。当您在浏览器中加载 swf 时,还必须从同一域将调试实用程序加载到浏览器中。
您可以让 LocalConnection 跨域工作,但它需要更多配置。这是有关该主题的 Flex 文档的链接。 Flash/Flex 也存在同样的问题。
http://livedocs.adobe.com/flex/3/ langref/flash/net/LocalConnection.html
By default LocalConnection allows communication between swfs loaded from the same domain. When you're loading the swf in the browser, the debug utility also has to be loaded in the browser from the same domain.
You can get LocalConnection to work across domains but it requires more configuration. Here's a link to Flex's docs on the subject. This issue is the same for Flash/Flex.
http://livedocs.adobe.com/flex/3/langref/flash/net/LocalConnection.html
我尚未使用
LuminicBox
,但如果您有权访问初始化接收LocalConnection
对象的代码,请调用allowDomain
("your.domain" )
在该对象上。如果接收 SWF 托管在 HTTPS 页面上,而发送者托管在普通页面上,则需要调用
allowInsecureDomain
。I haven't used
LuminicBox
, but if you have access to the code that initializes the receivingLocalConnection
object, callallowDomain
("your.domain")
on that object.If the receiving SWF is hosted on an HTTPS page and the sender on a normal page, you need to call
allowInsecureDomain
.我认为问题的一部分是我无权访问初始化接收 LocalConnection 对象的代码,只能访问发送 LC(我的应用程序)。
不过,我假设调试实用程序的作者肯定会使用 lc .allowDomain("*"); 将进一步检查,
我知道的唯一另一个原因是当您尝试打开一个新连接时,现有的 LC 连接已打开。
I think part of the problem is that I DON"T have access to the code that initializes the receiving LocalConnection object, just the sending LC (my application).
I would assume though, that the author of the debug utility would have definitely used lc.allowDomain("*"); Will check further.
The only other cause I am aware of is having an existing LC connection already open, when you try and open a new one.