Search code examples
actionscript-3facebook-graph-apiflashdevelop

Facebook ActionScript 3 API not working in FlashDevelop


I am writing a little test program, and I have a problem regarding the ActionScript 3 Facebook API (Graph_API_Web_1_8_1.swc).

I am using FlashDevelop, and I correctly added the SWC file to the "lib" folder.

I also imported the Facebook API correctly in my class file (the auto-finish function of FD recognizes all code from there).

BUT, once I start compiling my code, I get the following error:

Error: Access of undefined property Facebook

for each line of code, that includes a Facebook call (such as Facebook.init(...), Facebook.login(...) and Facebook.logout(...)).

I added a screenshot of my FlashDevelop setup to clarify things:

Enter image description here

This is even more mysterious to me, since the AIR application with the FacebookDesktop API is running without any errors.

How do I fix this problem?


Solution

  • This has happened to me several times. Don't waste your time looking into which ActionScript 3 SDK SWC version or Flex SDK you are using. It's just a weird bug. Instead, do the following.

    1. Close FlashDevelop
    2. Create a completely new project
    3. Add the Facebook SWC to library

    Then it should work. If not, reboot. It happened to me several times. I hope this helps.