Adobe just released the "ActionScript 3.0 Client Library for Facebook Platform API", which is a wordy name for a pretty straightforward AS3 Facebook API we've been working on for the past few weeks.
The library is an updated version of a library originally developed by Jason Crist. We've been working with Adobe, Facebook, and Jason to extend it to support all of the Facebook APIs (Canvas, Connect, and Desktop), and to clean up some of the code. That's not to imply that Jason's original work wasn't great, there's just a limit to how much you can do for free as one guy on an open source project.
The end result is an open source AS3 API that mirrors the documented Facebook API almost exactly. We've also added a few helper methods, and some samples to make it easier to get started.
You can get more info here, or grab the library from google code here.


Comments (28)
I am having problems with the webcam example. I didn't change any of the file and I am getting this everytime I run it:
TypeError: Error #1009: Cannot access a property or method of a null object
reference.
at WebCamUploader/WebCamUploader::sendUserToAllow()[C:\DropBox\My
Dropbox\Jeff\APIs\facebook_flash_api\facebook_library_v3.0_source\facebook_source\
Any ideas??
Posted by: Jeff at March 31, 2009 12:44 PMURL: http://twitter.com/jfall
It seems to be failing here for me:
protected function sendUserToAllow(p_event:MouseEvent):void {
fb.login(true);
}
Posted by: Jeff at March 31, 2009 12:48 PMAnd yes, I did enter my API Key and Secret Key... :)
URL: http://twitter.com/jfall
Great news for flash developers who want to leverage the engagement of the facebook platform. At sprout we are doing some cool campaigns and were a part of the AS 3.0 library facebook beta. Already have a working app. check it out here sproutinc.com/socialmedia
Posted by: Joey Mucha at March 31, 2009 01:21 PMURL: http://sproutinc.com
Could someone recommend any tutorials using the AS3 Facebook Platform API with the Flash IDE? Seems all the available examples are Flex based. Thanks in advance...
Posted by: PR Johnny at March 31, 2009 07:20 PMURL:
a lot of the demos I have tried won't work
Posted by: Jeff at April 1, 2009 09:29 AMURL: http://twitter.com/jfall
This is the webcam app:
http://apps.facebook.com/webcam_uploader/
It is still throwing that same error. Any ideas?
Posted by: Jeff at April 1, 2009 03:01 PMURL: http://twitter.com/jfall
Jeff & all Facebook API users. I have just posted updated demo source for all 3 demos to the Google code svn. You can browse the latest source here: http://code.google.com/p/facebook-actionscript-api/source/browse/#svn/trunk/examples.
Posted by: Wes at April 1, 2009 05:45 PMURL: http://www.gskinner.com/
How do I start a session in an iframe so i dont have to do the login in an external window?
Thx!
Posted by: Juan at April 2, 2009 04:45 PMURL: http://iamgoose.com
"How do I start a session in an iframe so i dont have to do the login in an external window?
Thx!"
I'd like to know how to do this too. ;-)
Posted by: Roberto Corrales at April 8, 2009 04:45 AMThanks from spain!
URL: http://www.iluyroberto.com
Just took a quick look at the web cam, where you pass the session_key as a var into the swf.
and establich the connection.
Ill try it out tonight.
Thanks
Posted by: Juan at April 8, 2009 08:37 AMURL: http://iamgoose.com
Is there a cut down version suited to ports. I emailed my question in more detail to your 'info' address.
Posted by: Justin Mills at April 12, 2009 06:54 AMURL:
Hello Grant,
Posted by: Panico at April 13, 2009 03:54 PMCan you tell the guy that made the ConnectJSdemo to fix it? (Or better, you fix it :P)
It seems that it's not working.
Please have a look at this thread:
http://groups.google.com/group/facebook-actionscript-api/browse_thread/thread/f6ef61562e004485
Thanks in advance
URL:
I would really like to know how the Ben and Jerry's approach works. The only example I've gotten to work forces the app to open a separate browser window, make the user login and close this window, and then click on a button in the app to trigger fb validation - after login is supposedly complete. This is very clunky compared to how it's done in the Ben and Jerry's example.
Posted by: Andy Roberts at May 7, 2009 08:48 AMURL:
The API itself is very well structured and really easy to get into.
I do however think it's lacking a lot of info on how to effectively integrate it with Facebook Connect. I count myself as a fairly weathered actionscripter and it took me an unecessary amount of time to get it working seamlessly with the 'opaque' facebook connect javascript.
I think the whole package would benefit from a few actual hands on examples. The ones on the adobe page that had one of yours just didn't really cut it when you were looking for a seamless application.
Either way, in the end everything works perfectly and my comment is more of a 'it could save time for a lot of people' than a complaint ;)
/sekasi
Posted by: Erik Hallander at May 12, 2009 07:35 PMURL: http://www.erikhallander.com/
Is anyone aware of any examples of using PublishUserAction, etc. (such as creating and working with Templates)? I've searched in vain for any AS-related discussions on the subject.
Great library, by the way!
Posted by: Chris H at May 15, 2009 08:29 PM--ChrisH
URL:
sekasi,
You say "I count myself as a fairly weathered actionscripter and it took me an unecessary amount of time to get it working seamlessly with the 'opaque' facebook connect javascript.", to help others who face the same issues, why not offer your code as an example of how to use connect.
Neil
Posted by: Neil at May 28, 2009 07:43 AMURL:
Grant,
I create AS3 Flash Apps in Flash Builder. From my tests it seems that this Library only works if you are using the Flex framework. Can you confirm this so I can stop running in circles?
Dan W
Posted by: Daniel Wilday at June 11, 2009 12:38 PMURL:
hi,guys,
im a very recent flash devloper, portuguese living in London, and im Despered, i can't understand faceBook API and get it to work , maybe because im really tired, well may be.
I just need to create something that in my point of view should be very simple, that is a share button in flash AS2 that when released share a title and a text to faceBook. SORRY to ASK this, you are probably very busy, but could you please help? something very simple like:
var TITLE:String;
var TEXT:String;
Share. onRelease = function () {
input_title = TITLE;
input_text = TITLE;
getURL ("http://www.facebook.com/share.php?u=www.mywebsite.com", "_blank", "post");
}
i dont want it to get the title from my index.html.
IN ADVANCE THANK YOU VERY VERY MUCH.
Posted by: Jose santos at November 14, 2009 11:55 PMi always will be able to you in case that you need me, what i truly doubt.
Jose.
URL:
If you see a blank page and its not working. One of the reason could also be that -
Posted by: Suma Gowda at December 6, 2009 12:44 PMyour Facebook App is not configured correctly; the ‘Connect URL’ wasn’t right.
Go through the FB Connect tutorials on the FB wiki. Take notes of the FB App settings, esp the ‘Connect’ tab. Your 'Connect URL' needs to point to the directory where your .swf file is located on the server.
URL:
Hi,
I just need a couple of info you may provide:
I have a site completly built with Flash, I’d like to create a section in my site where any user can see (by providing facebook username&pwd) all his facebook data (including photos, events, posts, etc…)
Do you think this is possible?
Posted by: Alarik at December 7, 2009 11:37 AM(I'm a very good flash developer but I know very little about facebook...)
URL:
I think Adobe should think twice before allowing you to develop the api because your example source codes don't work. If you are paid to develop the api, then you must provide better documentation and better source codes. can't believe I spent the whole day and can't make your examples work
Posted by: brooklyn at March 1, 2010 02:25 PMURL:
Firefox version 3.6 won't make flash facebook apps work. I updated my Firefox and since then my apps are not working. I tested the same apps on Firefox version 3.5.8 and things work
Sincerely,
Posted by: ny at March 2, 2010 12:10 PMURL:
@ny amen to you brother/sister. I just spent 3 hrs trying to connect from a local SWF export.
Firefox 3.6 (MacOS 10.5.8) did open up a window, but never actually navigated to the Facebook login page, and hence would not authenticate me.
Changed the default browser to Safari and that works. Thanks for your post I was going nuts.
Posted by: franz at March 12, 2010 01:08 PMURL:
Hi, Gskinner
I apologize about what I wrote above. The problem was not your source code, but ff3.6; Your example code work on all browsers but ff3.6;
Sincerely,
Posted by: brooklyn at March 21, 2010 09:27 AMURL:
When I am intending to record a video on facebook with my webcam I continuously receiving a report saying error fail to connect to the server. can this problem rectified
Posted by: Julius at April 21, 2010 09:52 AMURL: http://www.zim.gov.zw
Webcam and FB. Authori.
The FB login.php has changed Apr.2010 to the Graph API. so the Link in the Web: must be any from
// navigateToURL(new URLRequest("http://www.facebook.com/login.php?api_key="+API_KEY));
.e.g. the webcamUploader.as
changed into like:
// navigateToURL(new URLRequest("https://graph.facebook.com/oauth/authorize?client_id=XXX&redirect_uri=http://apps.facebook.com/YourCallbackfolder/scope=user_photos,user_videos,publish_stream,email,user_groups?api_key=XXX"));
}
than the webcam app is initializing the "allow". BUT.the webcam is stilll not showing the webcamimage.
anyone any ideas.
i would appreciating to connect me via facebook:
http://www.facebook.com/profile.php?id=100001200157853&
if you have a solution or not. in this case we should communicate.
and if anyone has a working webcam app. pls let me know.
Kind Regards
Posted by: Maximilian at June 9, 2010 08:02 AMMaximilian /euka lyptus/
URL: http://apps.facebook.com/myeukaapp/
Hi, i've a question about integrating the new like button in as3, this is possible?
Posted by: William Albert at July 2, 2010 01:54 PMURL: http://www.williamalbert.com.br/
I can't find any documentation on how to "Like" a page in AS3. Has anyone found a solution?
Posted by: Bert at July 27, 2010 04:31 PMURL: