The Flash Output Panel and Filter Level.
I just spent the last half hour trying to debug someone else's Flash application. Rather than actually debugging the application, I spent the entire time debugging Flash. Here was my problem: trace() wasn't working.
The trace() function in Actionscript (Flash) is akin to Javascript's alert() function. It is the simple and dirty way of setting a breakpoint in a program -- giving you a snapshot of what is happening in your program at a particular moment. This is enormously helpful when debugging an application. (In fact, you could say that it is debugging.) Output from this trace() function gets sent to the Output Panel in the Flash environment, allowing the programmer to determine what's wrong with the program. However, the Output Panel was completely empty; trace() wasn't outputting anything.
So I'm fiddling around in the Output Panel's dropdown, and see that I can change the Filter Level to None. My thought process at this moment is, since something is obviously filtering my output, setting the Filter Level to 'None' will fix my problem. That sounds logical, doesn't it?
It doesn't work. I then spend some time looking through Flash's docs on the trace() function, looking for obvious caveats for when it might not work. I see information on the Omit trace actions setting. Aha! The original developer had checked that box, so I uncheck it. This clearly explains why trace() isn't working. This is obviously the problem.
I test my program. trace() still is not working!!! I try all different sorts of scenarios, trying to locate the source of the problem.
Then comes the sudden realization -- change the Filter Level back to verbose. Setting it to None had also suppressed trace() output.
So, moral of the story: If you can't get the trace() function to work in Flash, make sure that Omit trace actions is turned off, and that the Filter Level is set to Verbose.
Oy, veh.

Trent, good to hear you got the problem figured out! It sure is frustrating when things don’t turn out how you first expect them when troubleshooting!! :)
Posted by: Jason at April 13, 2005 02:01 PM