02.02.2013 Views

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

Flash MX 2004 Games : Art to ActionScript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Flash</strong> <strong>MX</strong> <strong>2004</strong> <strong>Games</strong><br />

pressed. Code execution should halt and the debug window will look like the one shown in<br />

Figure 11.8.<br />

Figure 11.8 Debugging ‘Examples\Chapter11\debug16.fla’<br />

Once the code is halted you can use the debug window <strong>to</strong> examine the state of every variable<br />

that is currently available in <strong>Flash</strong>. Move through the different clips and levels using the list box<br />

at the <strong>to</strong>p left of the debugger. Clicking on the ‘_level0.Cat’ level allows you <strong>to</strong> examine the<br />

‘properties’ of this clip. Some of the properties can be altered by entering a new value: try altering<br />

the ‘_x’ property as you move the debugger, and the cat will jump <strong>to</strong> a new location across the<br />

screen. Moving the debugger window is necessary in order <strong>to</strong> force <strong>Flash</strong> <strong>to</strong> repaint itself, when<br />

halted at a breakpoint <strong>Flash</strong> is not running any code and so no repainting is occurring. Other<br />

properties are read only and cannot be altered by the developer; these properties are greyed out so<br />

that the value can be read but not altered.<br />

The variables tab lists the variables that are set in the clip. In this example this is just the ‘action’<br />

and the value for ‘moveX’. A right-click on the variable allows you <strong>to</strong> add this <strong>to</strong> the ‘Watch’<br />

panel. To avoid moving through several movie clips and layers, you can add certain variables <strong>to</strong><br />

164

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!