title: facebook actionscript graph api - using request_ids to retrieve users
body: <p>If I have used Facebook.ui() to allow the user to select a bunch of their friends, how can I use the returned request_ids array to access the friends /feeds please?</p>
  
  <p>I've tried the following:</p>
  
  <pre><code>Facebook.ui("apprequests", { message:"select some friends" }, handleAppRequest, "iframe");
  </code></pre>
  
  <p>which allows the selection of friends to tell about the app. I then do the following:</p>
  
  <pre><code>private function handleAppRequest(result:Object):void
  {
      Debug.logObject(result, this, "handleAppRequest");
  
      for (var i:int = 0; i &lt; result.request_ids.length; i++)
      {
          var requestID:String = result.request_ids[i];
          Facebook.api("/" + requestID, handleRequestFriends); 
      }
  }
  </code></pre>
  
  <p>to select the friends returned in the result object (which I think might be where I'm going wrong), and then this returns a fail:</p>
  
  <pre><code>private function handleRequestFriends(success:Object, fail:Object):void
  {
      if (success) trace("success");
      else trace(fail);
  }
  </code></pre>
  
  <p>Thanks in advance
  ob</p>
  
  <p>EDIT: (new users can't answer their own question)</p>
  
  <p>Hey again Michiel</p>
  
  <p>ah i got it</p>
  
  <p>it should be the following:</p>
  
  <pre><code>Facebook.ui("apprequests", { message:"select some friends" }, handleAppRequest, "iframe");
  
  private function handleAppRequest(result:Object):void
  {
      for (var i:int = 0; i &lt; result.request_ids.length; i++)
      {
          var requestID:String = result.request_ids[i];
          Facebook.api("/" + requestID, handleRequestFriends); 
      }
  }
  
  private function handleRequestFriends(success:Object, fail:Object):void
  {
      if (success)
      {
          var values:Object = 
          { 
              access_token:Facebook.getSession().accessToken,
              name:"This is my title",
              link:"http://example.com",
              picture:"http://example.com/facebook/facebooktutorial/canvas/images/icon-75x75.gif",
              caption:"this is a caption",
              message:"This is a test message on " + new Date().toString()
          };
  
          var friendID:String = success.to.id;
          Facebook.api("/" + friendID + "/feed", handleSubmitFeed, values, URLRequestMethod.POST);
      }
      else
      {
          Debug.logObject(fail, this, "handleRequestFriends");
      }
  }
  </code></pre>
  
  <p>One question tho - can i use the facebook friend selector and just return the results without the apprequest firing off to them?</p>
  
  <p>thanks
  ob</p>