crossdomain.xml 出现问题
我在使跨域策略发挥作用时遇到一些困难。 我在 http://www.server.com/
上有一个 swf,它加载 XML 和其他文件。我希望能够将该 swf 嵌入到不在同一域中的其他 HTML 页面(YouTube stylee)中。通过本地服务器 http://www.server.com/my.swf
或 http://www.server.com/swf.html
访问时,它工作正常但当我尝试嵌入时,它不会加载 XML 和/或给我一个安全沙箱违规
已发布的 SWF 设置为 Security.REMOTE
crossdomain.xml 允许所有:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>
希望您能提供帮助
更新1
嵌入代码的示例是:
<!-- Embedding -->
<object width='400' height='300'>
<param name='movie' value='http://www.server.com/my.swf'></param>
<param name='allowFullScreen' value='true'></param>
<param name='allowscriptaccess' value='always'></param>
<param name='FlashVars' value="stream=1281002679" ></param>
<embed src='http://www.server.com/my.swf' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='400' height='300'></embed>
</object>
...可以添加到任何域上的任何网页
更新
2policyfiles.txt(192.168.100.55是我包含嵌入示例的本地测试服务器):
OK: Root-level SWF loaded: http://www.server.com/my.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf
Warning: Failed to load policy file from http://192.168.100.55/crossdomain.xml
Error: Request for resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf is denied due to lack of policy file permissions.
flashlog.txt提炼 警告:无法从 http://192.168.100.55/crossdomain.xml 加载策略文件
我是否需要通过 Security.loadPolicyFile('http://www. server.com/crossdmoain.xml')
??
I'm having some difficulty getting my cross domain policy to work.
I have an swf at http://www.server.com/
that loads in XML and other files. I want to be able to embed that swf in other HTML pages (YouTube stylee) that aren't in the same domain. It works fine when access via it's local server http://www.server.com/my.swf
or http://www.server.com/swf.html
but when I try to embed it won't load the XMLs and/or gives me a Security sandbox violation
The published SWF is set to Security.REMOTE
crossdomain.xml allows all:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>
Hope you can help
UPDATE 1
An example of the embed code is:
<!-- Embedding -->
<object width='400' height='300'>
<param name='movie' value='http://www.server.com/my.swf'></param>
<param name='allowFullScreen' value='true'></param>
<param name='allowscriptaccess' value='always'></param>
<param name='FlashVars' value="stream=1281002679" ></param>
<embed src='http://www.server.com/my.swf' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='400' height='300'></embed>
</object>
... which could be added to any webpage on any domain
UPDATE 2
policyfiles.txt (192.168.100.55 is my local testing server containing embedded example):
OK: Root-level SWF loaded: http://www.server.com/my.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf
Warning: Failed to load policy file from http://192.168.100.55/crossdomain.xml
Error: Request for resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf is denied due to lack of policy file permissions.
flashlog.txt extractWarning: Failed to load policy file from http://192.168.100.55/crossdomain.xml
Do I need to load the crossdomain.xml via Security.loadPolicyFile('http://www.server.com/crossdmoain.xml')
??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您的 swf 尝试从本地服务器而不是 www.server.com 加载配置文件
您应该使用绝对路径
It looks like your swf tries to load the configuration file from your local server instead of your www.server.com
You should use an absolute path