Take the 2-minute tour ×

im currently working on facebook integration into my mobile AS3 game. I'am downloading friends pictures, which works just fine:

    public function updateView(id:String, data:Object):void {


    private function getfellaz(response:Object, fail:Object):void {     
        var a:int = response.length;
        arr = new Array();
        arr2 = new Array();
        var tempArrIDs:Array = new Array
        var k:int = 0
        for (var i:int = 0; i< a; i++ ) {
            arr.push(FacebookMobile.getImageUrl(response[i].id, 'large'));
        arrLength = arr.length-1;
        for(var x:int = 0; x<12; x++) {
            var r:int = dejMiTyRandomy();

then i draw pictures to bitmaps and work with them further... which is unrelated to my problem, i just can't figure out how to get " is_silhouette " property from user (in this case response object) object.

i tried to access this property


but that is appearently undefined, but when i try to acces users name,id...etc. this way, it works, like this:


and so on...

my question is, how do i access picture.is_silhouette property within this construction ?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Try changing the getImageUrl method to be the api method, with a call to "friend_id/picture" where "friend_id" is the id of the friend. Make sure that you append "?redirect=false" to get the json response.

Here's a method call with mine:


Here's the logic (completely written / untested):

public var hasSilhouette:Boolean = false;


hasSilhouette = false;

} else {

public function checkHasImage(user_id:int):void
  FacebookMobile.api(user_id+"/picture", checkHasImageResponse);

public function checkhasImageResponse(result:Object, fail:Object):void
  hasSilhouette = result.is_silhouette;

This returns a JSON response like this:

  "data": {
    "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-frc1/somenumbers.jpg", 
    "is_silhouette": false

is_silhouette is not part of the response from the "FacebookMobile.getImageUrl(response[i].id,...) method.

I believe you will have better luck using this Facebook documented method: (https://developers.facebook.com/docs/reference/api/#pictures)

In the future, I would handle testing by outputting the "response" object. That will show you everything you're getting. In this case, the "response" comes from /me/friends/ and doesn't have a reference to the "pictures" object.

Last, it's helpful to test Graph API calls in their Graph API Explorer: https://developers.facebook.com/tools/explorer

share|improve this answer
seems reasonable enough to try that, thanks, i'll definately look into it. I'll let you now about results :) –  Casper522 Apr 30 '13 at 17:22
Ok, then add a check first to see if the user has a silhouette / if they have an image set, if they do, then use the method you have defined, if not, use whatever placeholder photo you have. –  Dominic Tancredi Apr 30 '13 at 17:25
sorry, about the edit... my previous comment just didnt make any sense after your edited your answer –  Casper522 Apr 30 '13 at 17:27
Sure. By the way, I hate the callback structure / reference to a global variable in this. You CAN pass values but I wish it would allow returning values instead of a void in the callback. That would take us to blocks / lambda expressions and I don't think AS is ready for it...yet –  Dominic Tancredi Apr 30 '13 at 17:33
Edited my answer to have a bit of sample code (untested). –  Dominic Tancredi Apr 30 '13 at 17:33

Your Answer


