Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Facebook Graph API Development with Flash
Facebook Graph API Development with Flash

Facebook Graph API Development with Flash: Build social Flash applications fully integrated with the Facebook Graph API

Arrow left icon
Profile Icon Michael James Williams
Arrow right icon
$48.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (4 Ratings)
Paperback Dec 2010 324 pages 1st Edition
eBook
$26.09 $28.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Michael James Williams
Arrow right icon
$48.99
Full star icon Full star icon Full star icon Full star icon Empty star icon 4 (4 Ratings)
Paperback Dec 2010 324 pages 1st Edition
eBook
$26.09 $28.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$26.09 $28.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Facebook Graph API Development with Flash

Chapter 1. Introduction

Ready to start learning how to develop Flash Facebook applications? You will be in a few pages.

In this chapter, we will:

  • Learn what the big deal is about Facebook, and why you should be interested in developing an application for it

  • Get you set up with a web host, which you'll need for developing any online Facebook application

  • Establish how much AS3 you need to know already, and what to do if you don't

  • Take a quick look at the project that you'll be building throughout most of this book

  • Find out how to deal with the debugging complications that arise when developing a "browser-only" application like this

So let's get on with it...

What's so great about Facebook?


Seems like everyone's on Facebook these days—people are on it to socialize; businesses are on it to try to attract those people's attention. But the same is true for other older social networks such as LinkedIn, Friendster, and MySpace. Facebook's reach goes far beyond these; my small town's high street car park proudly displays a "Like Us On Facebook" sign.

More and more Flash games and Rich Internet Applications (RIAs) are allowing users to log in using their Facebook account—it's a safe assumption that most users will have one. Companies are asking freelancers for deeper Facebook integration in their projects. It's practically a buzzword.

But why the big fuss?

It's popular

  • Facebook benefits from the snowball effect: it's big, so it gets bigger.

  • People sign up because most of their friends are already on it, which is generally not the case for, say, Twitter. Businesses sign up because they can reach so many people. It's a virtuous circle.

  • There's a low barrier to entry, too; it's not just for techies, or even people who are "pretty good with computers;" even old people and luddites use Facebook. In February 2010, the technology blog ReadWriteWeb published an article called "Facebook Wants to Be Your One True Login," about Facebook's attempts to become the de facto login system throughout the Web. Within minutes, the comments filled up with posts from confused Facebook users:

    • Evidently, the ReadWriteWeb article had temporarily become the top search result for Facebook Login, leading hundreds of Facebook users, equating Google or Bing with the Internet, to believe that this blog post was actually a redesigned Facebook.com. The comment form, fittingly, had a Sign in with Facebook button that could be used instead of manually typing in a name and e-mail address to sign a comment—and of course, the Facebook users misinterpreted this as the new Log in button.

    • And yet… all of those people manage to use Facebook, keenly enough to throw a fit when it apparently became impossible to use. It's not just a site for geeks and students; it has serious mass market appeal.

  • Even "The Social Network"—a movie based on the creation of Facebook—held this level of appeal: it opened at #1 and remained there for its second weekend.

Numbers

  • According to Facebook's statistics page (http://www.facebook.com/press/info.php?statistics), over 500 million people log in to Facebook in any given month (as of November 2010). For perspective, the population of the entire world is just under 7,000 million.

  • Twitter is estimated to have 95 million monthly active users (according to the eMarketer.com September 2010 report), as is MySpace. FarmVille, the biggest game based on the Facebook platform, has over 50 million: more than half the population of either competing social network.

  • FarmVille has been reported to be hugely profitable, with some outsider reports claiming that its parent company, Zynga, has generated twice as much profit as Facebook itself (though take this with a grain of salt). Now, of course, not every Facebook game or application can be that successful, and FarmVille does benefit from the same snowball effect as Facebook itself, making it hard to compete with—but that almost doesn't matter; these numbers validate Facebook as a platform on which a money-making business can be built.

It's everywhere

As the aforementioned ReadWriteWeb article explained, Facebook has become a standard login across many websites. Why add yet another username/password combination to your browser's list (or your memory) if you can replace them all with one Facebook login?

This isn't restricted to posting blog comments. UK TV broadcaster, Channel 4, allows viewers to access their entire TV lineup on demand, with no need to sign up for a specific Channel 4 account:

Again, Facebook benefits from that snowball effect: as more sites enable a Facebook login, it becomes more of a standard, and yet more sites decide to add a Facebook login in order to keep up with everyone else.

Besides login capabilities, many sites also allow users to share their content via Facebook. Another UK TV broadcaster, the BBC, lets users post links for their recommended TV programs straight to Facebook:

Blogs—or, indeed, many websites with articles—allow readers to Like a post, publishing this fact on Facebook and on the site itself:

So half a billion people use the Facebook website every month, and at the same time, Facebook spreads further and further across the Internet—and even beyond. "Facebook Messages" stores user's entire conversational histories, across e-mail, SMS, chat, and Facebook itself; "Facebook Places" lets users check into a physical location, letting friends know that they're there.

No other network has this reach.

It's interesting to develop for

With all this expansion, it's difficult for a developer to keep up with the Facebook platform. And sometimes there are bugs, and undocumented areas, and periods of downtime, all of which can make development harder still.

But the underlying system—the Graph API, introduced in April 2010—is fascinating. The previous API had become bloated and cumbersome over its four years; the Graph API feels well-designed with plenty of room for expansion.

This book mainly focuses on the Graph API, as it is the foundation of modern Facebook development. You'll be introduced to it properly in Chapter 2, Welcome to the Graph.

Have a go hero – get on Facebook

If you're not on Facebook already, sign up now (for free) at http://facebook.com. You'll need an account in order to develop applications that use it. Spend some time getting used to it:

  • Set up a personal profile.

  • Post messages to your friends on their Walls.

  • See what all the FarmVille fuss is about at http://apps.facebook.com/onthefarm.

  • Check in to a location using Facebook Places.

  • Log in to some blogs using your Facebook account.

  • Share some YouTube videos on your own Wall from the YouTube website.

  • "Like" something.

    Go native!

Web hosts


If you've already got a publicly accessible web server or are signed up to a web host to which you can upload SWFs and HTML pages via FTP, skip to the How much AS3 knowledge is required? section.

What's a web host?

I'll assume that you roughly know how the Internet works: when you type a URL into a web browser on your computer and hit Go, it retrieves all the pages and images it needs from another computer, the web server, and displays them. The exact methods it uses to find the web server and the protocols for how the information gets back to your computer aren't relevant here.

You could go out and buy a computer, install some server software, and hook it up to your Internet connection, and you'd have a functional web server. But you'd have to maintain it and keep it secure, and your ISP probably wouldn't be very happy about you sending all those pages and images to other people's browsers. A better option is to pay another company to take care of all of that for you—a web host.

Why do you need one?

  • In order to build an online SWF-based application or game that allows users to log in with their Facebook account (with the SWF being able to access their profile, list of friends, Wall, and so on), you will require control over a web page.

  • Technically, you could probably come up with some hack that would allow you to get around this—perhaps by hosting everything on Google sites and MegaSWF—but in the long run it's not going to be worth it. Splash out on a web host for the sake of learning; you will definitely need access to one if you do professional Facebook application development in the future.

How do you choose one?

  • There are a huge number of web hosts to choose from, and an even bigger number of configurable options between them. How much disk space do you need? How much bandwidth per month? How much processing power? Some hosts will give you a server all to yourself, while others will put your files on the same computer as other customers. And of course, you have to wonder how good the customer service is and how reliable the company is at keeping their servers online. Throw in a few terms such as "cloud hosting" and it's enough to make your head spin.

  • All you need is a host that allows you to upload HTML files and SWFs; this book also assumes that you'll be able to use FTP to transfer files from your computer to the host, though this isn't strictly necessary.

  • Want to just get started without wasting time comparing hosts? Go with Media Temple. The code in this book was all tested using a Media Temple Grid Service account, available at http://mediatemple.net/webhosting/gs/. It provides much more than what you'll need for completing the projects in this book, granted, and at $20/month. It's not the cheapest option available, but the extra service and features will definitely come in handy as you build your own Facebook applications and games.

Useful software

You'll need an HTML editor for editing web pages. FlashDevelop and Flash Builder both do good jobs at this; otherwise, try:

And in order to transfer your files from your computer to your web host, you'll probably need an FTP client. Check out FileZilla (it's free and available for both Windows and Mac) at http://filezilla-project.org/. Documentation for this is available at http://wiki.filezilla-project.org/Documentation, and your web host will almost certainly provide instructions on connecting to it via FTP (Media Temple's instructions can be found at http://kb.mediatemple.net/questions/131/Using+FTP+and+SFTP)

What about domain names?

Web hosts will generally assign you a very generic address, such as http://michaeljw.awesomewebhost2000.com/ or http://sites.awesomewebhost2000.com/michaeljw. If you want to have a more condensed personal address such as http://michaeljw.com/, you'll need to pay for it. This is called a domain name—in this specific example, michaeljw.com is the domain name.

Media Temple allows you to buy a domain name for $5/year at the point where you sign up to their web hosting package. If you go with another host, you may need to buy a domain name elsewhere; for this, you can use http://www.moniker.com/.

You don't need to own a domain name to use this book, though. The generic addresses that your web host assigns you will be fine. Throughout the book, it'll be assumed that your website address (either generic or domain name) is http://host.com/.

Have a go hero – get a web host, upload to it, test

Pick a web host, get your credit card out, and sign up for one of their packages.

  1. Create a new directory called /test/ in the public path of your web host.

  2. Create a new plain text file on your hard drive called index.html. (It's a good idea to create a new folder on your computer to store all your work, too.) Open this file in your HTML editor.

  3. Copy the HTML below into the file:

    <html>
      <head>
      <title>Test</title>
      </head>
      <body>
        <h2>Hello!</h2>
      </body>
    </html>
  4. Hopefully, you know enough HTML to understand that this just writes Hello! in big letters.

  5. Transfer index.html to the /text/ directory on your host. Again, you'll probably need to use an FTP client for this.

  6. Open a web browser and type http://host.com/test/index.html into the URL bar. Of course, you should replace http://host.com/ with the path to your public directory, as given to you by your web host. You should see Hello! appear in a glorious default font:

  7. If not, check the documentation and support for your host.

How much AS3 knowledge is required?


  • You'll need to know some AS3 before you start using this book. Sure, it's a "Beginner's Guide", but beginner refers to your knowledge of Facebook development, not Flash development!

  • All of the code in this book is written using classes inside AS files; there's no timeline code at all. You don't have to be an OOP guru to follow it, but you must be familiar with class-based coding. If you aren't, check out these two resources:

  • You should also know how to create and compile a SWF project, and be familiar enough with HTML to be able to embed a SWF in it. We'll use SWFObject for this purpose (this is the default embed method used by Flash CS5); if you're not sure what this means, familiarize yourself here: http://code.google.com/p/swfobject/.

  • All important AS3 classes and keywords used in this book will be briefly explained as they become relevant, so don't worry if you haven't memorized the LiveDocs yet. Speaking of LiveDocs, remember that you can always use them to look up unfamiliar code: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html.

The source code


At the start of Chapter 2, Welcome to the Graph, you'll be given a Flash project that's just an empty user interface—it'll be up to you to build the backend using the lessons you learn from Chapters 2 through 6.

This project is called Visualizer, and contains the class structure and all the UI for an application that can be used to represent all of the information stored on Facebook. You'll go far beyond simply allowing people to log in to the application and grabbing their username; there is so much more that can be achieved with AS3 and the Graph API, and you'll learn about all of it.

Although the project is complex, the classes have been arranged in such a way that you need to modify only a small number of them, and these have little or no code in them to begin with. This means that you don't have to dive into mountains of code that you didn't write! You can focus entirely on learning about the Facebook side of Flash development.

Each of the Chapters from 2 to 6 has two associated ZIP files: one for the start of the project at the start of the chapter, and one for the end. This means you could skip through those chapters in any order, but you'll find it must easier to learn if you go through them in sequence. All project files are available in forms that are compatible with Flash CS3 and above, Flash Builder, and FlashDevelop—and if you use a different Flash editor, you should find it easy to convert the project.

When you first compile the project, it'll look like this:

Nothing much to see. But before long, you'll have added features so that it can be used to explore Facebook, rendering different Pages and Photos:

By the end of Chapter 6, you'll be happily adding code to search for users by name, exploring their personal profiles, and posting images and links to their Wall:

…plus plenty more besides!

Powered by…

In September 2010, Adobe released an official Adobe ActionScript 3 SDK for the Facebook Platform Graph API, which will remain fully supported by Adobe and Facebook. Read more about it at http://www.adobe.com/devnet/facebook.html. This book will teach you how to use this SDK, as it is a standard technology.

However, the main aim of this book is to teach you the underlying concepts of Facebook Flash development; once you understand these, the actual code and the SDK used don't matter. For this reason, this book will also teach you how to program every sort of Facebook interaction you might need from scratch. The code will be all yours, and you'll understand every line, with no abstraction in the way.

Besides the Adobe AS3 SDK for Facebook Platform, two other code libraries are used heavily:

Debugging

From Chapter 3 onwards your SWF will need to be run from your server, through a web browser, in order to work. (Find out why in that chapter.) This makes debugging tricky—there's no Output panel in the browser, so trace statements aren't automatically visible.

The Visualizer contains a dialog feature which you can use to work around this. It can be created from any class that is in the display list. To do so, first import the DialogEvent class:

import events.DialogEvent;

Then, dispatch a DialogEvent of type DIALOG with an argument containing the text you wish to see output:

dispatchEvent(new DialogEvent(DialogEvent.DIALOG, "Example"));

It will look like this:

Of course, that's useful only for the Visualizer project. What can you do when you build your own?

There are a few tools that will help:

In Chapter 3, you'll learn how to run a JavaScript function in your web page from the AS3 in your SWF. One JavaScript function, alert(), creates a little window containing any String passed to it, like so:

This is a quick and simple way to display one-off messages without using trace.

Watch out for caching

When you run a SWF using Flash Player on your desktop, it loads and runs the SWF. Well, of course, why wouldn't it?

When you run a SWF in a browser, this isn't always the case, though. Sometimes, browsers cache SWFs, meaning that they save a copy locally and then load that copy—rather than the online version—the next time you request it. In normal browsing, this is a great idea—it saves bandwidth and reduces loading times. You can lose huge amounts of time trying to figure out why your new code isn't working, only to finally realize that the new code isn't being run at all because you were seeing only a cached copy of your SWF.

Different browsers require different solutions. It's usually possible to disable caching for one browsing session, and it's always possible to delete some or all of the cache.

In Google Chrome, you can do this by clicking on [Spanner] | Tools | Clear Browsing Data…, selecting Empty the cache, and choosing an appropriate time period:

You should easily be able to find the equivalent option for your browser by searching Google for «browser name» delete cache.

A final note…


Facebook's developers are always tweaking the platform. This can make it exciting to develop on because new features are being added all the time, but it can also make it very frustrating to develop on because old features can be removed, or their implementations changed; anything could be altered at any time.

The new Platform API (the Graph API) is a strong foundation, and looks likely to be around for a while—remember, the previous Platform API lasted four years. But it's modular, and individual pieces might change, or even be removed.

It's possible then that parts of this book may be out-of-date by the time you read it, and some of the instructions might not give the same results with the current version of Facebook platform as they did when this book was written. If you're concerned about this, you can find out how to keep up-to-date with any platform changes in the last section of Chapter 8, Keeping Up With The Zuckerbergs.

But for now, dive into Chapter 2, Welcome to the Graph and start developing!

Left arrow icon Right arrow icon

Key benefits

  • Build your own interactive applications and games that integrate with Facebook
  • Add social features to your AS3 projects without having to build a new social network from scratch
  • Learn how to retrieve information from Facebook's database
  • A hands-on guide with step-by-step instructions and clear explanation that encourages experimentation and play

Description

The Facebook platform provides you with an ideal solution for building rich, social experiences on the web to develop an effective user experience application. Combined with Flash which effectively enables social interactions, you can create a fully functional application on Facebook. If you've been waiting to get started with your own applications and games on Facebook, with this book you don't have to wait any longer.This book takes you through everything you need to know to integrate your AS3 apps and games with Facebook accompanied by illustrative screenshots and short quizzes.It presents you with in depth coverage of the key underlying concepts such as creating a basic application that runs inside Facebook and exploring the Graph API which greatly simplifies how developers can retrieve data. This book also covers topics on security, permissions and authentication features on Facebook.This beginner's guide starts off by teaching you about retrieving simple public data and then rapidly working your way up to authenticating users, building powerful searches across the entire database, and uploading photos and other content. Throughout the book, you'll learn by building two fundamental components: an RIA Facebook interface and an AS3 SDK that you can drop into any project to add Facebook integration. This easy-to-understand guide has everything written as AS3-only projects with publicly available components, so you can follow along whether you use Flash Pro, Flex, or MXMLC – as long as you know AS3! This hands-on tutorial will present you with a whole new perspective of the three core aspects of Facebook – searching, retrieving, and updating the data .This practical book focuses on how to set up an application on Facebook and how to deal with different contexts like AIR.By the end of this book, you will be confident enough to set up your own application and create social interactions for users to share on Facebook.

Who is this book for?

If you are an AS3 developer who wants to create applications and games that integrate with Facebook – either on the Facebook website itself or off it, then this book is for you. Even if you have no previous experience with Facebook, databases, or server-side programming , you can count on this book.

What you will learn

  • Make your AS3 projects more social and personalise them for your users by adding Facebook integration
  • Grab information directly from Facebook into your applications by using Facebook s Graph API
  • Securely authenticate your users with OAuth 2.0 to log them into Facebook
  • Access information about your users and their friends directly from Facebook ‚Äì no need to make them type it all in again
  • Upload photographs, add wall posts, and create events through AS3
  • Search on Facebook s databases with the powerful Facebook Query Language
  • Build an AS3 Facebook SDK that you can drop into any AS3 project to add Facebook integration
  • Easily access both public and private Facebook data from the surface of a graph
  • Learn with exercises and fun examples illustrated with diagrams and screenshots
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 14, 2010
Length: 324 pages
Edition : 1st
Language : English
ISBN-13 : 9781849690744
Vendor :
Facebook
Languages :
Concepts :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Dec 14, 2010
Length: 324 pages
Edition : 1st
Language : English
ISBN-13 : 9781849690744
Vendor :
Facebook
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 103.98
Facebook Graph API Development with Flash
$48.99
Flash Facebook Cookbook
$54.99
Total $ 103.98 Stars icon

Table of Contents

8 Chapters
Introduction Chevron down icon Chevron up icon
Welcome to the Graph Chevron down icon Chevron up icon
Let Me In! Chevron down icon Chevron up icon
Digging Deeper into the Graph Chevron down icon Chevron up icon
Search Me Chevron down icon Chevron up icon
Adding to the Graph Chevron down icon Chevron up icon
FQL Matters Chevron down icon Chevron up icon
Finishing Off Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(4 Ratings)
5 star 50%
4 star 25%
3 star 0%
2 star 25%
1 star 0%
Juwal Bose Jan 27, 2011
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you are serious about FB (facebook) development, then i assure you this book is going to benefit you, so go ahead and buy it now. You can read the review later ;)So if any of you have tried FB development with flash, or with out flash for that matter, would definitely know that it is a PIA. The API keeps on changing every fortnight or so and even as i write this it had changed 2 days back, so you should hurry and get uptodate to give yourselves the edge thereby keeping ahead of all others. I am writing this review after half way through the book, realizing that I would end up spending a lot of time learning new things and testing new things related to the book. So i decided to spread the news right away as it would take time for me to finish it in a real sense.Let me list down the points that i noticed* Associated Codes are given in multiple formats, the Flash IDE, Flash Builder and Fashdevelop. This helps all kinds of users and we can easily see that even if your development environment is different, you can adapt the right one from any of these for your purposes.* Starts simple, gives you the code base for 'Visualiser' app which you can go through and understand how graph data is parsed and also as an added benefit you get to learn implementing Minimal comps. :)* FQL - get started with FB query Language, a very strong weapon in your FB development arsenal. If you have never used it, you will get to know what you were missing.* AIR deployment with StageWebView, which is the latest update with new flashplayer feature.* Start from scratch to deploy your app onto FB, either online or on desktop.* You may end up amazed by how easily we can poll graph data directly using the browser. Neat hacks and tips which can help you really understand how graph, connections etc work.* Searching for relevant data in the FB ocean.* Easily decode the json data returned by the graph using the AS3CoreLibSo this makes us realize that it is not for AS3 newbies, but you need to be good enough with AS3 to get started right away. Most of the support code of the visualizer app is not explained as it is out of context of the book, so you would need AS3 power to understand all those. You will find real solid OOP usage and implementation with examples which can really help out the developer in you even if you are not much interested in FB development. One thing i had noticed is that Michael could have used external Debuggers like Arthropod to show log data instead of a custom dialog event, but then we could easily make that change.So in the end, when it comes to FB you need to start early and proceed as fast as possible as social media is fast changing. FB is at the forefront of the revolution and we cant blame them for changing APIs so rapidly. This book surely helps you get started right away and get into the thick of things with the latest graph API and FB AS3 SDK. Even if you don't want to use the AS3 SDK (as updates for this is usually late when FB updates APIs) you can extend the native parsing information used in the earlier stages of the book to write your own classes for accessing FB data.So rush to download the book and get those source files and start exploring the vast FB ocean. Who knows what you may end up creating, but dont thank me, thank Michael.
Amazon Verified review Amazon
Rasmus Wriedt Larsen Feb 25, 2011
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've been so lucky to get a free copy of this book for review, and I must say: If you want to get into Facebook development, I would recommend this book to you!*** Overview ***You might be thinking: "Isn't this book only for Flash developers?" - Nope, it's also for everyone else who wants to learn how the Facebook Graph API works. It even has a chapter on the more advanced FQL (Facebook Query Language). Even if you have developed Flash applications for Facebook before, I'm sure you can find a lot of good tips in this book!It's very easy to follow, and include all the basic information you need to know. For each chapter, it goes though the general theory of the API (with examples), and then straight into how to actually use it.I would say this is a complete book for creating a Facebook application, with one little exception:Deployment - at least I experienced some trouble when I wanted to deploy my test application, but even though I had some trouble with it, I wouldn't say it has an impact on the overall quality of the book - it's still superb! (You can read my solution here: [...]*** Code ***It features code for FlashDevelop, the Flash IDE and Flash Builder, so no matter what you're using to code, you should be able to follow this book. It even has two folders for each chapter with code, one you can start out from, and one with the end result.This book is not about how to display the information you receive from Facebook. This is all handled by an UI the author supplies in the downloadable files. This is about how to get data from Facebook.The book uses two different methods for integrating with the Graph API, the official Adobe SDK, and a version the reader builds them self.*** Content of Book ***The book goes though getting basic information about anyone from Facebook, then getting authenticated so you can access information about the current user, to being able to get almost all the information Facebook has about the current user (if he allows it).Then it goes on to show how to add data entires to Facebook (posts, photos, albums, events, RSPSs, notes, likes, comments & checkins), and the few things you can delete from an application.It has a dedicated chapter on FQL (Facebook Query Language), which is a more advanced way of obtaining information from Facebook, that has some other possibilities - but also limitations.It ends off with a chapter with some very different information, how to deploy, edit and adjust your application on Facebook, how to integrate with AIR/Android, the Mochi Social Platform (for deploying on game portals) and other cool things!So if you're want to get into Facebook development, I would buy this book!
Amazon Verified review Amazon
Devon O Wolfgang Jan 24, 2011
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I am a Flash Platform developer who has created more FB applications than I care to recall. And I can honestly say that not once have I enjoyed it. 99 times out 100, the problems I have with Facebook applications stem from Facebook itself. It seems the API and terms of service change on a weekly (sometimes daily) basis. The documentation is horrendous and filled with code examples that simply don't work. The developer forums are filled with perfectly valid questions from frustrated devs that go ignored by FB administrators for days, weeks or just indefinitely. And the bug tracker at times seems overflowing with bugs marked as resolved which still regularly occur. And rather than hammer out all the problems with core functionality, Facebook spends its time trying out then removing new features such as the ability for app developers to acquire users addresses and phone numbers.But for all its problems, Facebook applications aren't, by default, a bad thing. And when Michael James Williams offered me the opportunity to check out a copy of his new book "Facebook Graph API Development with Flash", I jumped at the chance. Rightfully so, it seems. It turns out this book is a tremendous wealth of information. Whether you're just getting started or you've got a few hundred notches in your Facebook app belt, you're bound to find something useful in this book.One of the first really nice things you'll notice about this book is that it's development environment agnostic, at least as much as a book can be expected to be. When you download the related support files you'll find you get all the sample code laid out for the Flash Professional IDE, as a Flashbuilder project, or, my personal favorite, as a Flashdevelop project. So, regardless of your usual Flash workflow, you're bound to find some working examples that fit your style.The book starts off assuming you know a decent amount of Actionscript 3 coding, but nothing about Facebook development. You'll begin right off by making Facebook Graph API calls and examining the data and structures returned. You'll see how to easily convert the returned JSON objects into useable Actionscript objects (using classes from Adobe's as3corelib library openly available on github). And by the end of Chapter 2 you're basically already building a Flash powered Facebook application - easy peasy.The demo application that you build as you follow the book, while not exactly an exciting application in its own right, does a fantastic job of not only showing how API calls are made and returned but at visually demonstrating the various connections between Facebook objects - and connections are really what the shiny new Facebook Graph API is all about. Along the way, you'll not only learn how to write AS3 that integrates with Facebook from scratch but also how to use the 'official' Adobe/Facebook SDK. And the pop quizzes at the end of each chapter help get you thinking about the info you just learned as well as help that info `sink in' (though, I have to say, I wish the answers to the quizzes would have been included at the end of the chapter. I read the book on a Sony eReader and flipping to the end to see if I had the answers right or not was not really an option).For me personally, though, where this book really shines is in its introduction to FQL. Out of all the FB apps that I have built, I have never actually used FQL and can't even say why other than I never bothered to learn it. Now though, I can see how previous apps I have worked on would have seriously benefitted from it. In fact, I am actually looking forward to my next FB app, just so I can give FQL a whirl. If, like me, you have experience building Facebook apps with Flash, but have never bothered to learn FQL, this section of the book alone is worth the price of admission.Another section of the book that came as quite a pleasant surprise was a quick look at how to integrate Facebook functionality into an AIR for Android application using the StageWebView. This is very valuable and timely information I look forward to putting to good use.For as good as the book is, though, it isn't immune to all the problems with Facebook I mentioned previously. There are a few notable places where Michael provides some code examples then basically says, "This should work, but it doesn't. Maybe the folks at Facebook will fix this soon. Or maybe not". For example, just last week I was asked to integrate a Flash Facebook app into a tab of a fan page. After reading all the Facebook documentation and trying numerous things, I couldn't figure it out and settled for putting a static jpg image in the fan page tab that linked to the application page. So, needless to say, when I saw the chapter heading "Adding an Application to a Page Tab" mentioned in the table of contents, I was pretty excited. When I finally got to that section in chapter 8 though (I don't like to skip around in books, I read it straight through), I was more than a little perturbed to find this: "...it doesn't [work] at time of writing. Currently, tabs require FBML, rather than IFrames. But by the time you read this - and as already mentioned above - tabs will not accept FBML and will require IFrames. The documentation explaining how to incorporate IFrames into tabs does not exist yet, and it can't be tested, so unfortunately this book cannot explain how to do it. Sorry!" Well, at least that made me feel a little bit better about not being able to figure it out myself, but it doesn't really bolster my opinion of Facebook development in general.All things considered though, if you do any Flash / Facebook integration, I definitely recommend giving "Facebook Graph API Development with Flash" a read. You will certainly find something there that will make your life a lot easier. As the book itself indicates, it doesn't just simply throw a collection of code snippets at you, but gives an insight to the structure and organization of Facebook data, making it a little less stressful to deal with the inevitable changes you are bound to run across when developing for the FB platform.
Amazon Verified review Amazon
Shecky Bonus Nov 20, 2013
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
The book is written as a soup-to-nuts project, rather than a cookbook. Since a lot of the pieces are out-of-date (FB constantly changes APIs), the whole thing is a flop.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
Modal Close icon
Modal Close icon