Datasheet
Luchner c01.tex V3 - 03/20/2008 2:29pm Page 11
Chapter 1: The Development Environment
then you will have to manually enter the directory in which J ava is installed on your
machine. To do so, open the
jvm.config
file located in the
/bin
folder of your Flex 3
SDK installation directory. The first variable listed,
java.home
, needs to point to the
location of your installed Java Virtual Machine. Following the equals sign (=), enter that
location. For example, the JRE directory might be
C:/Program Files/Java/jre
.
Windows users must use forward slashes or double back-slashes for the l ocation. If you
don’t, then the error will be thrown again when you try to start the FDB.
5. To run the debugger, enter the command run in the console and press Enter:
<fdb> run
If you are prompted with a security alert requesting assistance regarding running the FDB,
select Unblock from the options. The console will display ‘‘Waiting for Player to
Connect.’’
6. Open a separate command prompt and change the directory to the project development
environment. For the purposes of this example, that is
C:
\
Development
\
AIR
\
HelloWorld
on
Windows and
/Development/AIR/HelloWorld
on Mac. Enter the following command and
press Enter:
> adl HelloWorld-app.xml
7. Switch to the console in which you started the Flash Debugger. You will see that the Flash
Player has connected and the debugger is waiting for additional commands to perform.
Enter the following and press Enter:
<fdb> continue
This will launch the Hello World application and display the following within the console in
which the FDB running:
Additional ActionScript code has been loaded from a SWF or a frame.
Set additional breakpoints as desired, and then type ’continue’.
8. Enter the continue command again and press Enter. The console will print out the
trace
statement you added to
HelloWorld.mxml
:
[trace] Hello World!
By launching the debug version of the application using the ADL, you can do simple debugging with
trace
statements and have the opportunity to have a more robust debugging platform by setting break-
points and fault handling if necessary. To stop the Flash Debugger, select the command prompt in which
it is running and press Ctrl+ConWindowsorQonMac.
Packaging
At this point, the SWF file has been compiled for your AIR application and you have your descriptor
file. You also ran a debug version through the FDB to ensure that everything is working correctly. Before
proceeding with packaging your application, if you have created a debug SWF, you may want to run
the
amxmlc
compiler again without the debug option to generate the SWF file to be included with the
installer file.
11