【发布时间】:2012-02-19 01:08:04
【问题描述】:
我有一个 PHP 脚本,它使用以下内容返回给我(和我的朋友)个人资料图片:
http://graph.facebook.com/".$ID."/picture?type=large
其中 $ID 是使用 PHP API 检索到的 ID。然后我使用以下内容在我的应用中加载图像:
public function LoadProfile()
{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onUrlLoaded);
loader.load(new URLRequest(ImageURL));
//ImageURL is the URL provided by the PHP Script
// which is the 'http://graph.facebook.com/XXXX/picture?type=large'
}
private function onUrlLoaded(event:Event)
{
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onUrlLoaded);
var path:String = LoaderInfo(event.target).url;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onReallyComplete);
var lc:LoaderContext = new LoaderContext(true);
lc.checkPolicyFile = true;
loader.load(new URLRequest(path), lc);
}
private function onReallyComplete(event:Event)
{
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onReallyComplete);
}
这适用于我所有的朋友,但由于某种原因不适用于我。我得到以下我朋友的图片的一般地址:
http://profile.ak.fbcdn.net/hprofile-ak-snc4/370825_524761447_653077984_n.jpg
但对我来说,我只是得到
这是一个随机的人......不是我......
我已经反复验证从 PHP 发回的 ID 实际上是我的 ID,并且我已经将在加载功能之前跟踪的地址复制/粘贴到浏览器中,并且我得到了正确的个人资料图片,但是在那里的某个地方,我的 ID 在负载中被窃听,并且只有我的 ID 在负载中(我应该改写它说它会因为任何用户登录到 Facebook,而不仅仅是我)。
有什么想法吗?或者有人知道获取我的个人资料照片的另一种方法吗?
【问题讨论】:
标签: php facebook flash profile image