在 HTML 容器中运行使用 localConnection 的 flash 组件时,我在弹出框中收到以下错误(flash player 是调试版本):
错误 #2044:未处理的 SecurityErrorEvent:。text=Error #2047:安全沙箱违规:LocalConnection.send:127.0.0.1 无法访问
在 HTML 容器中运行使用 localConnection 的 flash 组件时,我在弹出框中收到以下错误(flash player 是调试版本):
错误 #2044:未处理的 SecurityErrorEvent:。text=Error #2047:安全沙箱违规:LocalConnection.send:127.0.0.1 无法访问
将页面的 URL 从http://127.0.0.1/更改为http://localhost/解决了这个问题。
// 在接收文件的实例化之后添加这一行
receiveSwf_lc.allowDomain("localhost");
// 或者你喜欢的任何域名,使用 * 作为通配符来允许任何域名
您也可能想要添加一个 crossdomain.xml 文件,但这里有一个不错的解释:http ://scottrockers.com/blog/resources/flash-information/workaround-solution-to-flash-error-2044-unhandled-securityerror -and-error-2048-security-sandbox-violation
您也可以添加主机文件条目并将其指向 127.0.0.1。