I prefer to develop completely outside the Flash or Flex IDEs to be able to use my more preferred *nix based development tools (terminal/vim/screen/git/diff etc).

To do this I write plain text actionscript files and externally link all assets using the [Embed(source="image-or-font-here")] to add them at compile time. I compile the actionscript file with the Flex SDK from the terminal.

$ mxmlc MyAwsomeProject.as

Trace statements are the only thing that the IDE offered but as you can see below it's possible to set up the flash player to show trace statements as you run your flash program in the browser.

Three things need to happen for trace statements to appear when you run flash from the browser.

1. The Debug Flash Player must be installed as the flash player that your browser uses to play flash
2. A file must exist in your home directory to tell the flash player to log trace statements
3. configure your terminal to display the log with the command 'trace'

1. Installing the Debug Flash Player

Download the tar file from the adobe website: http://www.adobe.com/support/flashplayer/downloads.html

Get the one titled Linux Debugger and Standalone Players for Flash Developers or some similar name.

Unzip the tar, you should see a README and two directories.
plugin contains files for the flash player that runs in the browser.
standalone contains files for a player that runs outside the browser. I like the plugin version because I use ExternalInterface in some of my development. External Interface is a javascript bridge and requires the browser environment to run correctly.

In the directory ./plugin/debugger there are two tar files. one is the plugin module, and the other is the plugin module plus the install script.

I prefer to place the module file in the right directory rather than use the install script. A quick google search shows that the install script does not work very well. "please enter the installation path of mozilla netscape"

unzip the flash player module

$ tar -xzf libflashplayer.so.tar.gz

then find the existing flash player module and replace it, and back up the old one first of course.

$ find /usr/lib -name libflashplayer.so
/usr/lib/nsbrowser/plugins/libflashplayer.so

on my gentoo system the file is just a symlink to another file

libflashplayer.so -> /opt/netscape/plugins/libflashplayer.so

$ cd /opt/netscape/plugins/
# or the directory your "libflashplayer.so" file is in
$ mv libflashplayer.so orig.libflashplayer.so

At this point I like to open my browser and make sure flash is not found to ensure that we've moved the plugin that is currently beeing used.

now move the new libflashplayer.so file into this directory

$ mv /path/to/newly/downoaded/libflashplayer.so ./

Restart your browser, if you right click on a flash player you should see "Debugger" in the menu now. I don't use the debugger but I did notice that when it appeared it meant I had successfully installed the debug flash player.

2. Telling the flash player to log trace statements

Make a file in your home directory to tell the flash player to log errors and trace statements.

$ nano ~/mm.cfg

add these three lines

ErrorReportingEnable=1
TraceOutputFileEnable=1
MaxWarnings=50

Now any runtime errors that happen while your swf is running should appear as popups, any trace statements should be logged to:

~/.macromedia/Flash_Player/Logs/flashlog.txt

Another indication that you've correctly installed the debug flash player will be the existence of the Logs directory. it will be automatically created once you have the flash debug player installed and you've created the ~/mm.cfg file with the error level settings.

3. Configuring your terminal to easliy open a log with the command 'trace'

Add this to your ~/.bashrc file.

alias trace='tail -f ~/.macromedia/Flash_Player/Logs/flashlog.txt'

then open a terminal and enter the following to enjoy the trace statements from the flash player.

$ trace