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
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
10
Checkins and Facebook Places

Loading multiple Graph API objects, in a single request


Multiple objects can be loaded in a single Graph API request. As explained in the Developer Documentation:

You can also request multiple objects in a single query using the "ids" query parameter. For example, the URL https://graph.facebook.com?ids=arjun,vernal returns both profiles in the same response.

This differs from the URL-oriented approach used for the other Graph API methods, but luckily, implementing it doesn't require much of a change to our ActionScript code, so long as we have the IDs or usernames of the objects we want to load.

In this recipe, we're going to load the data for a series of Facebook Pages, information that we would otherwise have to load with separate requests.

How to do it...

In this recipe, we're going to load the Facebook Page objects of a few well-known companies—Facebook, Coca-Cola, and Pepsi. If we were to load their data separately, we'd need to make the following three requests, with code similar to this...