You
can use the debugger version of Flash Player to capture output from
the global trace() method and write that output
to the client log file. You can use trace() statements
in any ActionScript or MXML file in your application. Because it
is a global function, you are not required to import any ActionScript
classes packages to use the trace() method.
Only debug SWF files will write out trace() statements.
To create a debug SWF file, set the debug compiler
argument to true.
The following example defines a function that logs the various
stages of the Button control’s startup life
cycle:
Messages that you log by using the trace() method
should be Strings. If the output is not a String, use the String(...) conversion
function, or use the object’s toString() method,
if one is available, before you call the trace() method.