Time for action – searching via the SDK

It's easy to make our search work via the SDK, too. Start by opening SDKRequestor.as and adding a new function called search(), just as we did with the HTTPRequestor:public function search(a_query:String = "", a_type:String = ""):void

{
  
}

As with a request, we pass three parameters to the Facebook.api() method:

  1. /search (a string containing the key part of the Graph URL)
  2. A reference to a callback function
  3. An object containing the parameters (q and type – remember not to use query as the name of the parameter!)

So, add this call to your search() function as shown in the following code:

public function search(a_query:String = "", a_type:String = ""):void
{
  Facebook.api(
    "/search", 
    searchComplete, 
 { metadata: ...

Get Facebook Graph API Development with Flash now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.