到现在为止,我真的厌倦了 facebook 的 crossdomain.xml ,终于让它可以从服务器加载图片了。现在我需要使用 flash 从我的应用程序加载变量。我收到此错误。
Error: [strict] Ignoring policy file at http://apps.facebook.com/crossdomain.xml due to incorrect syntax. See http://www.adobe.com/go/strict_policy_files to fix this problem.
*** Security Sandbox Violation ***
Connection to http://apps.facebook.com/feline-frenzy/endpoints/challengewin/ halted - not permitted from http://media.varheroes.com/flash/endpointstest.swf
Error loading data
Error: Request for resource at http://apps.facebook.com/feline- frenzy/endpoints/challengewin/ by requestor from http://media.varheroes.com/flash/endpointstest.swf is denied due to lack of policy file permissions.
有什么解决办法吗?
这是我的代码:
Security.loadPolicyFile("http://api.facebook.com/crossdomain.xml");
Security.allowDomain("*");
Security.allowInsecureDomain("*");
myData = new LoadVars()
myData.load("http://apps.facebook.com/feline-frenzy/endpoints/challengewin/")
myData.onLoad = function(succes){
if(succes){
trace("DATA SAVED!!!1");
} else trace ("Error loading data")
}
最佳答案
我不确定 Facebook 是否允许直接从 Flash 访问 apps.facebook.com。尽管根目录中的 crossdomain.xml 是默认文件名和位置,但您可以将其设置为任何您想要的。例如,如果可以是 apps.facebook.com/policies/flashpolicy.xml,或者他们能想到的任何其他内容。他们这样做的原因是为了防止人们完全按照您的意愿行事。
您当然可以为您要使用的服务使用代理。您的服务器上会有一个脚本,可以为您向 facebook 发出请求。所以不要点击 http://apps.facebook.com/feline-frenzy/endpoints/challengewin/你会打http://yourserver.com/facebookProxy该代理脚本会向 facebook 发出 http 请求并返回您要查找的数据。
这只是一个example用 PHP 编写。
关于flash - Facebook 政策文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2133784/