Adobe Flex 3 Help

Starting a debugging session

You start a debugging session by using the fdb command-line debugger. After you start a session, you typically type continue once before you set break points and perform other debugging tasks. This is because the first frame that suspends debugging occurs before the application has finished initialization.

For more information about which commands are available after you start a debugging session, see Using the command-line debugger commands.

Starting a session with the stand-alone Flash Player

You can start a debugging session with the stand-alone debugger version of Flash Player. You do this by compiling the application into a SWF file, and then invoking the SWF file with the fdb command-line debugger. The fdb debugger opens the debugger version of the stand-alone Flash Player.

The debugger version of the stand-alone Flash Player runs as an independent application. It does not run within a web browser or other shell. The debugger version of the stand-alone Flash Player does not support any server requests, such as web services and dynamic SWF loading, so not all applications can be properly debugged inside the debugger version of the stand-alone Flash Player.

Debug with the stand-alone Flash Player

  1. Compile the Flex application's debug SWF file and set the debug option to true.

    The following example compiles an application with the mxmlc command-line compiler:

    mxmlc -debug=true myApp.mxml 
    
    

    You can also compile an application SWF file by using the web-tier compiler or the Flex Builder compiler. For more information on Flex compilers, see About the Flex compilers.

  2. Find the flex_install_dir/bin directory. You installed the Flex application files to this directory.
  3. Type fdb from the command line. The fdb prompt appears.

    You can also open fdb with the JAR file, as the following example shows:

    java -jar ../lib/fdb.jar
    
    
  4. Type run at the fdb prompt, followed by the path to the SWF file, as shown in the following example:
    (fdb) run c:/myfiles/fonts/EmbedMyFont.swf
    
    

    The fdb debugger starts the Flex application in the debugger version of the stand-alone Flash Player, and the (fdb) command prompt appears. You can also start a session by typing fdb filename.swf at the command prompt, rather than by using the run command.

Starting a session in a browser

You can start a debugging session in a browser. This requires that you pre-compile the SWF file and are able to request it from a web server.

Debug in a browser

  1. Compile the Flex application's debug SWF file and set the debug option to true. The following example compiles an application with the mxmlc command-line compiler:
    mxmlc -debug=true myApp.mxml 
    
    

    You can also compile an application SWF file by using the web-tier compiler or the Flex Builder compiler. For more information on Flex compilers, see About the Flex compilers.

  2. Create an HTML wrapper that embeds this SWF file, if you have not already done so. For more information on creating a wrapper, see Creating a Wrapper.
  3. Copy the SWF file and its wrapper files to your web server.
  4. Find the flex_install_dir/bin directory. You installed the Flex application files to this directory.
  5. Type fdb in the command line. The fdb prompt appears.

    You can also open fdb with the JAR file, as the following example shows:

    java -jar ../lib/fdb.jar
    
    
  6. Type run at the fdb prompt:
    (fdb) run
    
    

    This instructs fdb to wait for a player to connect to it.

  7. In your browser, request a wrapper that embeds the debug SWF file. Do not request the SWF file directly in a browser because some browsers do not allow you to run a SWF file directly.

    Alternatively, you can type run filename.html at the command line, and fdb launches the browser for you. The filename should include the entire URL; for example:

    (fdb) run http://localhost:8100/flexapps/index.html