Specifications

CHAPTER 11
232
}
]]></mx:Script>
<mx:Label text="{reportVersion()}"/>
<mx:Label text="{reportType()}"/>
</mx:Application>
Other properties of the Capabilities class include hasPrinting, os, and language.
Client-side logging and debugging
Often, you use the trace() method when you debug applications to write a checkpoint message on the client,
which signals that your application reached a specific line of code, or to output the value of a variable.
The debugger version of Flash Player has two primary methods of writing messages that use trace():
The global trace() method. The global trace() method prints Strings to a specified output log file. For
more information, see
“Using the global trace() method” on page 232.
Logging API. The logging API provides a layer of functionality on top of the trace() method that you can
use with your custom classes or with the data service APIs. For more information, see
Using the logging API” on
page 233.
Configuring the debugger version of Flash Player to record trace() output
To record messages on the client, you must use the debugger version of Flash Player. You must also set
TraceOutputFileEnable to 1 in your mm.cfg file. For more information on editing the mm.cfg file, see “Config-
uring the debugger version of Flash Player” on page 229.
The debugger version of Flash Player sends output from the
trace() method to the flashlog.txt file. The location
of this file is determined by the operating system. For more information, see “Log file location” on page 231.
Using the global trace() method
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 appli-
cation. Because it is a global function, you are not required to import any ActionScript classes packages to use the
trace() method.
The following example defines a function that logs the various stages of the Button control’s startup life cycle:
<?xml version="1.0"?>
<!-- logging/ButtonLifeCycle.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">