flash - 从 Facebook 加载图像时出现策略文件错误

标签 flash facebook

我在 facebook 上制作游戏排行榜。我没有使用连接,而是在 Canvas 内工作。当我尝试从 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);

有任何想法吗?不过,我正在导入正确的类(class)。

更新:
我正在加载来自不同域的图像,比如调用 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');

有了这条线,一切都应该正常工作。

关于flash - 从 Facebook 加载图像时出现策略文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2112823/

相关文章:

Flash过时了,那html5或者css3真的有那么强大吗?

flash - 露水音频播放器在Blogger中不起作用

ios - Facebook 弹出窗口在 iOS 中变成空白

ios - 如何使用 Swift 在 iOS 中以编程方式进行搜索

javascript - CreateJS 和 Flash Pro

flash - 实用的Actionscript/Flash AS3代码使反编译器崩溃

flash - Actionscript 对象的属性数

objective-c - 喜欢页面的Facebook ios SDK,“应用程序不具备此功能”

javascript - 将 'and one other person like this' 添加到我的站点后,如何更改它的颜色?

Android Facebook 样式幻灯片