using the trace() method.

March 12, 2008

After all these days working with Flex i never used the trace() method and to tell the truth
i didn’t even look at this statement before, like what it does and what it really means.
And when i found the usage of this statement i really felt bad for my ignorance,as my boss always
says “kumar iam not happy with your ignorance”,hope this line doesn’t hurt anyonce’s feelings.

The trace() method is very usefull when debugging your App, it gives out the clear trace of the
statements in your App and keep track of values in the App while debugging.The output can be observed
in the output window [ Console Window ],the values or statements we trace.

Example statements:

private var dtf:Date;
dtf=new Date();
trace(dtf.getTime());
trace(dtf.getHours());
trace(dtf.getMinutes());
trace(dtf.getSeconds());
trace(dtf.getHours()+”:”+dtf.getMinutes()+”:”+dtf.getSeconds());

Now debug the App and observe the results in the condole Window.

similarly another statement,

var i:int;
for(i=0;i<10;i++)
{
trace(i);
}   

like wise we can use the trace() method, its a simple statement but verypowerfull.console window.

console window is shown above.Enjoy the code.