views:

13

answers:

1

I'm using the official Adobe Facebook API in my Flash/AS3 application and for some reason the call the /me/picture seems to fail whereas the the call the /me/friends seems to work just fine:

This works OK:

Facebook.api('/me/friends', onFriendsLoaded );

protected function onFriendsLoaded( response:Object, fail:Object ) : void
{
   // I can get the friends from the response object
}

This fails:

Facebook.api('/me/picture', onPictureLoaded );

protected function onPictureLoaded( response:Object, fail:Object ) : void
{
   // Here response is null and fail is ÿØÿà
}

I'm calling both methods right after each other. What could be the problem?

+1  A: 

The /me/picture call is actually not an api call at all. http://graph.facebook.com/me/picture is the url of the photo. You can actually set an image to that url. I am not an expert in Flash, but if you were doing this in html you would do the following:

<img src="http://graph.facebook.com/facebook_id/picture" />

This would show the users picture. Additionally, if you wanted to download the picture's bytes you would just make a normal web request. The response stream would be the image file.

Nathan Totten
Thanks. That makes perfect sense actually.
Luke