96
Chapter 4: Debugging Scripts in Director
Viewing variables in the Debugger window
The Variable pane of the Debugger window displays the variables associated with the current
handler. The current handler is the handler displayed in the Script pane and the last handler
displayed in the Call Stack pane. You can also display the variables associated with previous
handlers in the call stack. As you step through a script, changes to the values of any of the
variables are displayed in red. For more information on stepping through scripts, see
“Stepping
through scripts in the Debugger window” on page 97
.
To display the variables associated with a handler in the call stack:
•
Click the name of the handler in the Call Stack pane. The variables appear in the
Variable pane.
The Variable pane includes four tabs for viewing variables:
The All tab
displays both global and local variables associated with the current handler.
The Local tab
displays only the local variables associated with the selected handler.
The Property tab
displays the properties declared by the current script.
The Global tab
displays only the global variables associated with the selected handler.
You can sort the variables in the Variable pane:
•
To sort the variables by name, click the word
Name
that appears above the variable names.
•
To sort the variables in reverse-alphabetical order, click the word
Name
a second time.
You can change the values of local variables of the current handler and global variables in the
Variable pane. You cannot change the value of local variables that are not in the current handler.
To change the value of a variable in the Variable pane:
1
Double-click the value of the variable in the Value column.
2
Enter the new value for the variable.
3
Press Enter (Windows) or Return (Macintosh).
Viewing objects in the Debugger window
With the Watcher pane in the Debugger window, you can view variables and other data objects
associated with the current handler, as well as objects associated with other handlers. By adding
objects to the Watcher pane, you can keep track of their values as they change because of scripts.
When the value of an object changes due to the execution of a line of code, Director changes the
color of the object’s name in the Watcher pane to red.
The Watcher pane displays only the objects you add to it. You can use up to four separate tabs in
the Watcher pane to organize objects into groups.
To add an object to the Watcher pane whose name appears in the Script pane:
1
Select the name of the object in the Script pane.
2
Click the Watch Expression button.
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...