I cannot over. emphasize. my. love. of. the. Trace. Command (ok, maybe I can overemphasize it)
Seriously though, when it comes to debugging my AS3 code, trace() is invaluable!
For example, when trying to create different start buttons for mouse and keyboard controls I was trying to send navigation events, and changing variables, creating variables... sometimes, at first I wasn't sure if the code I implemented worked so I used trace to spit out some information into the 'output' tab. (It's down between 'Properties' and 'Compiler Errors')
Here's how you use it:
- trace( variableName ); // Outputs the value of that variable
- trace( "Your Text Here" ); // Outputs 'Your Text Here'
- trace( "AvoiderGame.as Line 37 xSpeed = ", xSpeed ); //Outputs 'AvoiderGame.as Line 37 xSpeed = 6' (or whatever the value of xSpeed is...)
Easy Peasy Lemon Squeezy!
Ah, trace() is indeed a godsend!
ReplyDeleteIf you like that, let me also recommend De MonsterDebugger. It's like trace() on steroids: http://www.demonsterdebugger.com/
Dude...
ReplyDeleteThat is awesome! And easy to implement too... Once I get a better feel for it, I'll have to write a mini-review.