I Have seen alot of sample where the API key is hard coded into, unless you are building a desktop there is no need to do this. Facebook provides the API key, and the session key in the iframe url. Your application should retrieve the keys from the url, this makre your code more portable.

Url Variables:

  • fb_sig_api_key
  • fb_sig_session_key
  • fb_sig_ss

UPDATE – 9/10/10

With the new changes to face book app, make sure that you go into the advanced setting and check canvas session parameters.

    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:
    [js]
    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();
    [/js]

    When you come to think of it web2.0 was about rich Internet applications, using platforms like Ajax. Flash and Siverlight. rich in the sense that they could function and animate as well as desktop applications. But web2.0 didn’t necessarily mean that you had a rich user experience. An example is Facebook here is a nice web2.0 application but it still lacked user experience, it was somewhat cumbersome in how I interact with parts of the web site( or web application). 

    Rich User Experience is what keeps the user engage. Engaging the user and keeping them engaged is a complex thing to so. Giving In you face content or the BAM! factor will cause some people to engage but not all users will respond the same way. I don’t believe that Rich User Experience has to always be something that is flashy or slick, It measured by the user time on your web site plus the re visiting of the user.

    I believe that one can achieve this by building intelligent sites that offer a passive guidance to the user as he/she navigates the web site. Amazon has been doing this for years and are a good example. How good is a web site that I don’t engage with frequently.