我在Facebook上制作游戏排行榜。我没有使用连接,但在画布内工作。当我尝试从Facebook加载图像时,它给了我下面的错误。加载图片时出现策略文件错误facebook
SecurityError: Error #2122: Security sandbox violation: Loader.content: http://test cannot access http://profile.ak.fbcdn.net/v22941/254/15/q652310588_2173.jpg A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
这里是我的装载代码
public var preLoader:Loader;
preLoader=new Loader();
**update**
Security.loadPolicyFile('http://api.facebook.com/crossdomain.xml');
Security.allowDomain('http://profile.ak.fbcdn.net');
Security.allowInsecureDomain('http://profile.ak.fbcdn.net');
**update-end**
public function imageContainer(Imagewidth:Number,Imageheight:Number,url:String,path:String) {
preLoader=new Loader();
Security.loadPolicyFile("http://api.facebook.com/crossdomain.xml");
var context:LoaderContext = new LoaderContext();
context.checkPolicyFile = true;
context.applicationDomain = ApplicationDomain.currentDomain;
preLoader.load(new URLRequest(path),context);
什么想法?我正在导入正确的课程。
UPDATE: 我从不同的域说加载图像,调用FUNC http://fahim.com图像是从http://profile.ak.fbcdn.net/v22941/254/15/q652310588_2173.jpg东西(我已经确定的图片是静态的不需要Facebook登录或任何东西,他们只是用户公开资料图片)
如果你是从Facebook加载,那么你为什么从felinefrenzy.com加载策略文件? – Amarghosh 2010-01-22 04:25:06
@Amarghosh,对不起,我没有更新那里。在我原来的代码中,我使用的是facebook crossdomain。我刚刚更新了。它仍然给我完全相同的错误。 @ sberry2A,是的,我需要更改名称,我现在正在使用不同的网址,然后是facebook提及等等。虽然所有的变化仍然给我同样的错误。 – 2010-01-22 07:06:55
你确定这行吗'context.checkPolicyFile = true;'?是原始代码本身的一部分吗?在所述位置的政策文件似乎没问题。 – Amarghosh 2010-01-22 13:49:40