The current wrapper page for the application (YourLastNameHelloUser.html) is an HTML page that was generated automatically by Flex Builder. It contains the code to check for the correct version of Flash Player needed to run your application.
When you make your application accessible on the Facebook
website, your wrapper page will need some additional functionality. When your
application is accessed from a web page on the Facebook server instead of
directly on your own web server, the application does not need to include code
to have the user manually log into the application; the user will already be
logged into Facebook and the Facebook server will send to your application a
collection of GET URL variables containing info about the user session. The
wrapper page for the application on your server must pass these variables to
the SWF file; this is how your application will get Facebook session data now
instead of using the FacebookUtilSession.login() method as you did
when it was a desktop application in the first tutorial.
In order to keep the wrapper page server-agnostic, you will use an HTML page that uses JavaScript to parse the URL variables and pass them to the SWF file. The wrapper page must also contain the JavaScript Flash Player detection code. You will use the open-source SWFObject used by many Flash Platform developers. You can learn more about SWFObject from documents on the Google Code repository and the article, Detecting Flash Player versions and embedding SWF files with SWFObject 2.
Return to your LastNameHelloUser project in Flex Builder.
Note: This is the project you created in Create
your first Facebook application with Flex. If you did not complete that tutorial, you can
import the starter project: Download project files, select File > Import >
Flex Project, and then browse to the downloaded archive file. This is the Flex
project for an external Facebook Flex website application. To start this
tutorial, you must also sign
up with Facebook (if you are not already),
follow the steps to add the Facebook
Developer application and register the application, change the name of the project and application to reference your last
name instead of mine, and then change the code inside the init() function to use the API key and secret your
application was assigned in the Facebook Developer application.
Unpack the ZIP file and place the two files it contains, index.htm and swfobject.js, in the src directory of your project with your MXML file (see Figure 1).
Figure 1. Adding the new wrapper page files for your application.
Change the line of code referencing the embedded SWF file on line 25, so that it uses the name of your SWF file, for example, StallonsHelloUser.swf.
swfobject.embedSWF("StallonsHelloUser.swf",
"flashContent", "100%", "100%",
"9.0.0", "expressInstall.swf", flashVars);
Select Flex Compiler from the list of items on the left, and then clear the check box for Generate HTML wrapper file (see Figure 2).

Figure 2. Unchecking the option to automatically generate a wrapper file.
Change the Debug, Profile, and Run paths to point to your index.htm file (see Figure 3), for example, /facebook apps/YourLastNameHelloUser/bin-debug/index.htm.

Figure 3. Editing the Flex Builder run configuration for the application.