Today we announced that we’re going to be working with Facebook to help Flash Platform developers continue to create great applications on the world’s best social platform. You can find a lot of good developer information on our new Facebook Developer Center. Since we’re dealing with social content, I figured it would be fun to combine Adobe Flash Collaboration Services and Facebook for a real time social collaboration experiment. Using the excellent getting started tutorial and AFCS, I created a simple app. When you load it, you’re a guest and you can see people using the whiteboard, chatting, and sharing files. If you want to collaborate with everyone else, you need to log into Facebook. The application pulls your name and geographic information from Facebook and lets you publish content. The application is here and you can grab the source files here. You’ll need to make sure pop-ups are enabled to connect to Facebook.
As I said, the application is pretty basic. I’m using default pods from AFCS and the basic Facebook authentication. The only thing remotely unique is that I’m pulling in the user data from Facebook and using the AFCS APIs to change the APIs:
public function onConnect(event:FacebookEvent):void { var call:FacebookCall = facebook.post(new GetInfo([facebook.uid],[GetInfoFieldValues.ALL_VALUES])); call.addEventListener(FacebookEvent.COMPLETE,onComplete); } public function onComplete(event:FacebookEvent):void { fbUser = (event.data as GetInfoData).userCollection.getItemAt(0) as FacebookUser; cSession.userManager.setUserRole(userId,UserRoles.PUBLISHER); cSession.userManager.setUserDisplayName(userId,fbUser.first_name + " " + fbUser.last_name + " (" + fbUser.current_location.city + ", " + fbUser.current_location.state + ", " + fbUser.current_location.country + ")"); }
The first function gets called when we connect; we use the new AS3 Facebook library to get information about the user. Then after that is complete, we set the user data to a FacebookUser object and use the AFCS APIs to change the user name and the room “role” so that the user can publish content to the room.
I kind of threw this together at the last minute, so expect bugs. I apologize in advance if (when) you run into them.
Tweet
