Accessibility

Table of Contents

Debugging Client-Side Code in Flex Applications

Flash Player Tracing()

The Flash Debug Player provides support for simple logging to the flashlog.txt using the trace() function. You can use the trace() function when debugging to write variable values or other diagnostic information to the flashlog.txt. The following example uses the trace function in a simple ActionScript function TestEffectHandler().

function TestEffectHandler(): Void {
            var counter:Number;
            var tempCounter:Number = 0;;
            for (counter=0; counter<5; counter++) {
                        tempCounter=counter+tempCounter;    
                        trace("Counter = " + counter);
                        }
            debugText.text = "Total Counted = " + tempCounter.toString();
}

When you invoke the TestEffectHandler() function, it writes the following data to flashlog.txt.