Simple Flash Trace Debug Mode
August 13th, 2010I thought I would share a little snippet I use from time to time to allow me to turn on and off the trace function in my Flash work.
Basically instead of typing “trace(‘hello world’);” you type “debug(‘hello world’);”.
Then once you are done developing the swf you just change the debugMode variable to false and turn off all your trace functions to save a good bit of processing in the final product. It’s quite handy.
Here is the code I use:
var debugMode:Boolean = true;
function debug(STRING:String){
if(debugMode){
trace(STRING);
}
}

This is a funny flash game where you have one minute to find a way to save the drowning boy in the pool. It is a little morbid but it’s really funny and memorable and people like games that surprise them. This was a project that was made with another artist and a musician. Click see more to play the game.







