加载图片形式的Facebook政策文件错误 [英] Policy file error while loading images form facebook
问题描述
$ p $
SecurityError:错误#2122:安全沙箱冲突: Loader.content:http:// test不能访问http://profile.ak.fbcdn.net/v22941/254/15/q652310588_2173.jpg一个策略文件是必需的,但是checkPolicyFile标志在载入这个媒体时没有设置。
这是我的加载器代码
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 =新的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);
任何想法?我正在导入正确的类。
更新:
我加载的图像来自不同的域说,调用func < a href =http://fahim.com =nofollow noreferrer> http://fahim.com 图片来源于 http://profile.ak.fbcdn.net/v22941/254/15/q652310588_2173.jpg 东西(我确认了图片是静态的不需要Facebook登录或任何东西,他们只是用户公开的个人资料图片)
这是image policy file:
Security.loadPolicyFile('https://fbcdn-profile-a.akamaihd.net/crossdomain.xml );
使用这行代码,一切都可以正常工作。
I making a game leaderboard on facebook. I'm not using connect but working inside the canvas. When I try to load the images from facebook it gives me the following error.
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.
Here is my loader code
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);
Any Ideas? I am importing the right class though.
UPDATE: I am loading the images from a different domain say , calling func http://fahim.com images are from http://profile.ak.fbcdn.net/v22941/254/15/q652310588_2173.jpg something ( I have made sure the pictures are static do not require a facebook login or anything , they are just user public profile pictures)
This is the url to the image policy file:
Security.loadPolicyFile('https://fbcdn-profile-a.akamaihd.net/crossdomain.xml');
With this line everything should work just fine.
这篇关于加载图片形式的Facebook政策文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!