加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flash – 从facebook加载图像时出现策略文件错误

发布时间:2020-12-15 07:22:27 所属栏目:百科 来源:网络整理
导读:我在facebook上制作游戏排行榜.我没有使用连接但在画布内工作.当我尝试从Facebook加载图像时,它给出了以下错误. SecurityError: Error #2122: Security sandbox violation: Loader.content: http://test cannot access http://profile.ak.fbcdn.net/v22941/2
我在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);

有任何想法吗?我正在导入正确的课程.

更新:
我从不同的域加载图像说,调用func http://fahim.com图像是从http://profile.ak.fbcdn.net/v22941/254/15/q652310588_2173.jpg的东西(我已经确定图片是静态的,不需要Facebook登录或任何东西,他们只是用户公开个人资料图片)

解决方法

这是映像策略文件的URL:

Security.loadPolicyFile('https://fbcdn-profile-a.akamaihd.net/crossdomain.xml');

有了这条线,一切都应该工作得很好.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读