Avg. Rating 4.4

Problem

How to debug a Flex application that is running inside a Facebook application canvas page.

Solution

Remotely debug your application with Flex Builder.

Detailed explanation

You can debug Flex applications embedded on a Facebook canvas page by remotely debugging in Flex Builder.

Here is what you need to do:

1. Add your breakpoints to your Flex code
2. Upload and place your SWF on your Facebook canvas page (make sure it is a debug SWF)
3. Point your Flex Builder debugger to launch your Facebook canvas page:
        a. Run > Debug > Other
        b. In "URL or path to launch" uncheck "Use defaults"
        c. Replace the "Debug" URL with the URL to your Facebook canvas page, for example "http://apps.facebook.com/myFlexFacebookApplication"
        d. Click "Debug"
4. Interact with your Flex app, when it hits your breakpoint Flex Builder should pop up as usual

(My Facebook application is currently set as an iFrame application, not sure how this performs with that option set to FBML)

From here you could create a script that automatically uploads your debug SWF to your server every time it gets compiled.

Report abuse

Related recipes