Facebook政策文件错误

时间:2010-01-25 16:31:38

标签: flash facebook

到现在为止,我对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") 
} 

2 个答案:

答案 0 :(得分:2)

我不确定Facebook是否允许直接从Flash访问apps.facebook.com。虽然root中的crossdomain.xml是默认文件名和位置,但您可以将其设置为您想要的任何内容。例如,如果可以是apps.facebook.com/policies/flashpolicy.xml,或者其他任何他们可以想到的东西。他们这样做的原因是为了防止人们完全按照你的目的去做。

当然,您可以使用代理服务器来使用您想要使用的服务。您将在服务器上有一个脚本,可以为您提供Facebook的请求。因此,不是点击http://apps.facebook.com/feline-frenzy/endpoints/challengewin/,而是点击http://yourserver.com/facebookProxy,该代理脚本会向facebook发送http请求并返回您要查找的数据。

这里只有一个用PHP编写的example

答案 1 :(得分:0)

只是在这里猜测,但我注意到您对Security.loadPolicyFile("http://api.facebook.com/crossdomain.xml");的调用中的网址与错误中的网址不同(说它无法在apps.facebook.com/crossdomain.xml读取政策文件)

第二个网址也是您的myData.load("http://apps.facebook.com/feline-frenzy/endpoints/challengewin/")网址的根目录,您可以在此期望Flash查找政策文件。

这有助于缩小问题的范围吗?