flash – 从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);

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

更新:
我从不同的域加载图像说,调用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');

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

相关文章

  译序:JWMediaPlayer是开源的网页使用的Flash播放器。本...
    Flash编程原理都是只能将1写为0,而不能将0写成1.所...
 上传setenvgatewayip192.168.1.1;setenvserverip192.168.1...
Error:FlashDownloadFailed-"Cortex-M3"出现一般有...
jPlayer是一个用于控制和播放mp3文件的jQuery插件。它在后台...
#ifndef__FONTUPD_H__#define__FONTUPD_H__#include"sy...