User Guide

trace() 217
trace()
Availability
Flash Player 4.
Usage
trace(expression)
Parameters
expression
An expression to evaluate.
Returns
Nothing.
Description
You can use Flash Debug Player to capture output from the trace() function and write that
output to the log file.
Statement; evaluates the expression and writes the result to the log file.
Use this statement to record programming notes or to write messages in the log file. Use the
expression parameter to check whether a condition exists, or to write values to the log file.
Example
The following example uses a trace() statement to write the methods and properties of the
dynamically created text field called
error_txt to the log file:
this.createTextField("error_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
for (var i in error_txt) {
trace("error_txt."+i+" = "+error_txt[i]);
}
/* output:
error_txt.styleSheet = undefined
error_txt.mouseWheelEnabled = true
error_txt.condenseWhite = false
...
error_txt.maxscroll = 1
error_txt.scroll = 1
*/
CHAPTER 5
ActionScript Core Language Elements