User Guide

Debugging in the Message window 89
For example, if you type the following statement into the Message window:
-- Lingo syntax
put(50+50)
// JavaScript syntax
trace(50+50);
and press Enter (Windows) or Return (Macintosh), the result appears in the Output pane:
-- Lingo syntax
-- 100
// JavaScript syntax
// 100
If you type the following statement into the Message window:
-- Lingo syntax
_movie.stage.bgColor = 255
// JavaScript syntax
_movie.stage.bgColor = 255;
and press Enter (Windows) or Return (Macintosh), the Stage becomes black.
You can test multiple lines of code all at once by copying and pasting statements into the Message
window or by pressing Shift+Return after each line of code.
To execute multiple lines of code by copying and pasting:
1 Copy the lines of code to the clipboard.
2 Enter a blank line in the Message window.
3 Paste the code into the input pane of the Message window.
4 Place the insertion point at the end of the last line of code.
5 Press Control+Enter (Windows) or Control+Return (Macintosh). Director finds the first blank
line above the insertion point and executes each line of code after the blank line in succession.
To enter multiple lines of code manually:
1 Enter a blank line in the Message window.
2 Enter the first line of code.
3 Press Shift+Return at the end of the line.
4 Repeat steps 2 and 3 until you have entered the last line of code.
5 Press Control+Enter (Windows) or Control+Return (Macintosh). Director finds the first blank
line above the insertion point and executes each line of code after the blank line in succession.
You can test a handler without running the movie by writing the handler in a Movie Script or
Behavior Script window, and then by calling it from the Message window.
To test a handler:
1 Copy and paste or manually enter a multiline handler into the Message window as described in
the previous two procedures.
2 Place the insertion point at the end of the last line of code.
3 Press Enter (Windows) or Return (Macintosh). The handler executes.
Any output from
put() or trace() statements in the handler appears in the Message window.