Book Image

Flash Facebook Cookbook

By : James Ford
Book Image

Flash Facebook Cookbook

By: James Ford

Overview of this book

Flash applications are popular and becoming increasingly social. With flash applications for facebook you can tap into a potential audience of half a billion existing users, their connections and affiliations, their uploaded images, posts, comments and more.The Flash Facebook Cookbook is packed with recipes for the Graph API and FQL, used for reading and writing data as well as interacting with Facebook anonymously or on behalf of an authorised Facebook User.The topics covered by the recipes in this Cookbook include working with News feeds, uploading Photos, searching for and plotting Places on a map and much more. The cookbook has recipes ranging from those that work without any authentication with Facebook to those that do, and act on behalf of a user. Packed with recipes that yield practical demonstrations of the Graph API functionality, the Flash Facebook Cookbook is an essential tool for Flash Platform developers.
Table of Contents (18 chapters)
Flash Facebook Cookbook
About the Author
About the Reviewers
Checkins and Facebook Places

Deleting a Comment

Deleting a comment on Facebook is much the same process as for deleting any other Graph API object with the same restrictions.

In this recipe, we're going to take the end result from the previous recipe, which uses a List component and item renderers to present the comments for a Graph API object and to these Item Renderers we'll add functionality to delete comments.

Getting ready

To introduce the delete capability to our application, we should add a Button component to the FacebookCommentItemRenderer class with an ID of delete_btn.

How to do it...

To delete the comment from the Graph API, we make a request with the comment's ID, with a request options object that includes the property method with the value of 'delete', as follows:

var option:Object = new Object();
option.method = "delete";
Facebook.api(COMMENT_ID, responseHandler, option, "post");
  1. 1. Into our existing Item Renderer, we should add a click event handler for the delete_btn component, which makes this request...