Facebook Connect to Actionscript 3

Facebook has launched Facebook Connect a little more than a month ago and it has seen a major adaptation on the Internet now. We’ve seen it in action on TechCrunch, Digg, Vimeo and a dozen of other sites. Together with Google Friend Connect (and maybe MySpace Data Availability) it announces a time of one social profile on multiple sites with features like friend linking, profile information exchange and bunch of easy tools for content sharing (on Facebook for instance).

At Proximity BBDO, we try to make user integration and participation on campaign sites as easy as possible and just hitting the ‘Connect with Facebook’ button is easy. I’ve been working on a bridge to link the Javascript implementation of Facebook Connect to a Flash or Flex site.

An example of a Facebook Connect Flash application can been seen here. It currently supports automatic login, retrieving friend list and friend information (can take a while), current application users, sharing a link on Facebook, posting a predefined story and updating your story (make sure you set the status permissions first).

Example of the Facebook Connect Bridge

I have deliberately chosen to fully implement the results in Flash rather than merely providing a wrapper for the Javascript calls and dealing with the result in Flash itself. At the moment I’m of course limited to the things I program in Flash (the calls and the results).
But as we have to deal with automatic login and javascript popups, this way was easier to integrate in a Flash website and, moreover, the Javascript library is built with a HTML website in mind. So, it allows you to use the same library in your average website and listen to any event that passes along (login, disconnects, friends, a status that has been set, …)

Update: I have included the inviting of friends as well. They will receive an invitation for the application in their Facebook inbox. One downside, at the moment, is that there is a redirect after successfully inviting friends. I’m still working on fixing that.

Update 2: The code library is available at github.com as project FBFlashBridge.