Scripts do not always do what you want the first time. The script often has an error in its syntax:
possibly a word is misspelled or a small part of the script is missing. Other times, the script might
work but does not produce the expected result. Mistakes or bugs almost always occur when
writing your scripts, so you should allow enough time for debugging when you develop
multimedia titles.
As your skill with scripting increases, you'll probably encounter different types of problems as you
master one area but start learning others. However, the basic troubleshooting techniques
described here are useful for novice and advanced users alike.
The best way to correct a bug in your scripts varies from situation to situation. There are not
one or two standard procedures that resolve the problem. You must use a variety of tools and
techniques, such as the following:
•
An overview and understanding of how scripts in the movie interact with each other
•
Familiarity and practice with common debugging methods
The following tools help you identify problems in scripts:
•
The Message window, when tracing is on, displays a record of the frames that play and the
handlers that run in the movie.
•
The Debugger window displays the values of global variables, properties of the script that is
currently running, the sequence of handlers that ran to get to the current point, and the value
of variables and expressions that you select.
•
The Script window lets you enter comments, insert stopping points in the script, and select
variables whose value is displayed in the Object inspector.
•
The Object inspector lets you view and set the values of objects and properties you select.
Debugging Scripts in Director
CHAPTER 4
83
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers