Debugging

 < Day Day Up > 



The most frustrating part of making a Flash movie is when you choose Control ® Test Movie and it doesn't work. The most common error is incorrect spelling. When writing your ActionScript, you need to take extra care to spell things correctly each time you use them or reference an instance or a Movie Clip. It's important to check your movies frequently so you don't get to the end of a large project and discover it isn't working. It's a good practice to check and debug after each stage of your movie.

Fortunately, Flash provides some tools for tracking down additional problems. It's easy to forget to select a frame in an action's layer and attach a button action to a frame that doesn't contain a button; this, of course, will return an error when you test your movie.

Following is a short list of troubleshooting tips to be aware of as you develop and test your movies:

  • Check your syntax often. In the Actions panel, use the Check Syntax button.

  • Use capitalization where needed. For instance gotoandplay won't work because it needs to be gotoAndPlay. Capitalization is important.

  • Include semicolons at the end of statements.

  • Use curly braces to enclose the statements of handlers and loops.

  • Be sure your target path is correct.

  • Be sure all Movie Clips and buttons are instances and have unique instance names.

  • Be sure all variables and functions have unique names.

Debugger panel

In the Debugger panel, you can monitor Movie Clip instances, variables, and properties. The Flash Debug Player is automatically installed. This player opens the Debugger. To use the Debugger press Shift+F4 or choose Window ® Debugger. To activate the Debugger, choose Control ® Debug Movie. Figure 30-1 shows that you can see the contents of the movie and that it is paused by default. Click the green Control button in the Code View menu to continue.

click to expand
Figure 30-1: The Debugger panel

The top portion of the Debugger panel is the Display list with the absolute path and nesting of all the current Timelines including all Movie Clips. You can also access properties and variables from their respective tabs. The Watch tab lets you monitor specific variables on any Timeline.

Debug from a browser

You can now access the Debugger panel to debug your movie from a Web browser. If you choose Debugging Permitted in the Publish Settings Default tab options, you can access the Debugger panel from the Debug Movie environment or from a browser that has the Flash plug-in. (You need to install the Flash Debug Player plug-in or ActiveX control. You can find it in the Players folder of your Flash MX application folder.) You should also require a password so others can't access the Debugger.



 < Day Day Up > 



Macromedia Studio MX Bible
Macromedia Studio MX Bible
ISBN: 0764525239
EAN: 2147483647
Year: 2003
Pages: 491

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net