The Art of Debugging

Imagine, for an instant, that your animation isn't behaving the way you think it should. Testing it on the Stage or in Flash Player and then eyeballing the results, as described in the previous section, is a good place to start tracking down the problem.

But if you've added ActionScript to your animation, chances are you need more firepower. You need to be able to step through your animation frame by frame and examine the inner workings of your ActionScript code—the variables, instance names, function calls, and so on—to help you figure out what's wrong.

You need the Flash debugger, shown in Figure 13-11. Unfortunately, unless you're familiar with ActionScript, much of the information the debugger displays isn't helpful. But even if you're new to ActionScript, the debugging tools you see in this section will give your bug-fixing skills a boost.

The Debugger shows you what Flash is thinking behind the scenes. This panel shows the instance names, property values, variable names and values, and other ActionScript keywords and statements that either you (or Flash) added to your animation.

Figure 13-11. The Debugger shows you what Flash is thinking behind the scenes. This panel shows the instance names, property values, variable names and values, and other ActionScript keywords and statements that either you (or Flash) added to your animation.

Because the Flash debugger shows you a combination of ActionScript code and the Flash object model, its usefulness in debugging your animations is directly proportional to your knowledge of these two things.

For example, if you have no idea how function calls work or what ...

Get Flash CS3: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.