When I started developping a bit seriously in ActionScript, I quite immediatly searched a debugging tool in Adobe Flash Professional, as I use while working in PHP or Java. And fortunately, this feature is available is available.
However, all AS developers I worked with don’t know those debugging capabilities, using extensively trace instead.
Debugging allows you to see, wherever in the execution flow of your code, the state of your objects (object attributes values, local variables, movieClip properties…). It is terribly simple and convenient.
Say you want to know the value of a variable somewhere in the middle of the execution of the function.
Instead of tracing this value (ending up with a code cluttered with “trace” statements, and having to republish each time you put a new trace), you can ask Flash to pause the execution within this function, and to tell you the value of this (and all other) variables.
You just need to
- open your AS file in Adobe Flash CS3
- set a break point on the line you want to check (right click/toggle breakpoint)
- run the movie in debug mode (CTRL+Shit+Enter)
Then the debug window should open. You just have to click the green arrow to get to the line with the breakpoint. You can add new breakpoints as you debug. You can also follow the execution line by line, by clicking the “step over” button.
On the right side of the debug window, you can browse through the variables and properties of the current object.
If you have a main flash embedding other swf, to debug the other swf, you need in the “publish setting” of those to tick “Permit debugging”.
More info here!
