Facebook JS Client API for Flash/Flex

In my experience i have found that using the JavaScript client library for Facebook and the External Interface API in flash is alot more responsive than the Adobe Facebook AS3 library. Sometimes the event fails to fire. The only time you should use the adobe library is when you need to upload fotos, and do so by sharing the session data used by the JavaScript client.

Example of sharing a session:

fb= new Facebook();
var session:WebSession;
session=new  WebSession(Application.application.parameters.fbsigapikey,
Application.application.parameters.fbsigss,
Application.application.parameters.fbsigsessionkey);
session.addEventListener(FacebookEvent.CONNECT, function():void{
var bytes:ByteArray = jpegencoder.encode(lastpumpyourselfbm.bitmapData);
var call:UploadPhoto = new UploadPhoto(bytes);

fb.post(call);

 });
fb.startSession(session);
session.verifySession();

2 comments

  1. Hi,
    I try to use your “sharing a session” example and I have a question for you.

    Do you know why my fb.uid is null?

    Thanks

  2. It could be a number of things. If in the iframe the fb_sig_user is not being passed in means the user isnt logged in, or hes user privacy setting are being passed in. This is a way of obtaining the userid. IF the javascript is retuning null it could be timing out or the user privacy settings. do you want to send me a developer url to help you debug

Leave a Reply

Your email address will not be published. Required fields are marked *