Time for action – literally

  1. Open HTTPRequestor.as and find the publish() function. Create a native AS3 object within the function like so:
    var actionObj:Object = [ { 
       name:"Visit my Twitter Page", 
       link:"http://twitter.com/MichaelJW" 
    } ];
    

    Square brackets define an array, so we could type this as an Array rather than an Object, but it doesn't really matter.

  2. Next, in the same function, use the JSON library that we've used before to decode this object into a JSON string:
    var actionString:String = JSON.encode(actionObj);
    
  3. Now, add this String as a property of the URLVariables object, called actions:
    variables.message = a_publishObject.message; variables.picture = a_publishObject.pictureURL; variables.link = a_publishObject.linkURL; variables.name ...

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.