Archive

Posts Tagged ‘adobe’

How to configure Flex for writing debug information to a file.

February 12th, 2008 joelhainley No comments

So you’re bumping along doing some work in Adobe Flex using the flex sdk and you need to get some debug information about what’s going on in one of your applications. You know that the guys using Adobe’s Flex Builder IDE have source level debugging but you don’t have the Flex Builder or, for whatever reason, don’t want to use it.

Here’s a quick how-to for setting up flex debugging to an output file, plus a link to a very simple test application that is known to work so that you can ensure that you have debugging setup properly on your test machine before you start tearing your hair out.

  1. You need to ensure that you have the debug version of the Flash Player installed. You can find instructions on installing the Flash Debug Player here. The instructions appear to be a bit dated, in the version of the SDK that I have on my development box there is no “uninstall_flash_player.exe”. I simply ran the “Install Flash Player 9.exe” and then after rebooting my system seemed to work fine. Notice that the link above also allows you to validate that you have successfully installed the debug player.
  2. To enable writing to a text file you will need to create a mm.cfg file on your system placing it in the appropriate directory for your operating system.
    • OSX : /Library/Application Support/Macromedia/mm.cfg
    • Windows : C:\Documents and Settings\<username>\mm.cfg
    • Linux : /home/<username>/mm.cfg
  3. Now open the file you’ve just created and add the the following 2 lines to the file :
    • ErrorReportingEnable=1
    • TraceOutputFileEnable=1
  4. That’s about all there is to it, although I think I ended up rebooting before it worked properly. Now go to a simple Flex test app I threw together to generate output data to the file.
  5. Click on the button labeled “Click Me”.
  6. If you have been successful in setting up the debugging you should see output written to a file appropriate for your operating system :
    • OSX : /Users/<username>/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt
    • Windows : C:\Document and Settings\<username>\Application Data\Macromedia\Flash Player\Logs\flashlog.txt
    • Linux : /home/<username>/Macromedia/Flash_Player/Logs/flashlog.txt
  7. Next time we’ll get into some more advanced debugging tools available.