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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.