Writing scripts in the Script window
77
•
To locate a handler in the current script, select the handler’s name from the Go to Handler
pop-up menu in the Script window.
•
To compile any modified scripts, click the Script window’s Recompile All Modified Scripts
button or close the Script window. When you modify a Script, an asterisk appears in the Script
window title bar, indicating that the script needs to be recompiled.
•
To compile all scripts in a movie, select Recompile All Scripts from the Control menu.
•
To reformat a script with proper indentation, press Tab in the Script window.
Director automatically indents statements when the syntax is correct. If a line does not indent
properly, there is a problem in the syntax on that line.
•
To open a second Script window, Alt-click (Windows) or Option-click (Macintosh) the New
Cast Member button in the Script window. This can be helpful for editing two different
sections of a long script simultaneously.
•
To toggle line numbering, click the Line Numbering button.
•
To toggle Auto Coloring, click the Auto Coloring button. Auto coloring displays each type of
Lingo element (properties, commands, and so on) in a different color.
•
To toggle Auto Formatting, click the Auto Format button. Auto Formatting adds the correct
indenting to your scripts each time you add a carriage return or press Tab.
Note:
The auto coloring and auto formatting features do not apply to JavaScript syntax code.
Therefore, if you are authoring scripts using JavaScript syntax, the Auto Coloring and Auto Format
buttons in the Script window are disabled, and terms such as
function
,
var
, and
this
will appear in
the default text color.
Finding handlers and text in scripts
The Find command in the Edit menu is useful for finding handlers and for finding and editing
text and handlers.
To find handlers in scripts:
1
Select Edit > Find > Handler.
The Find Handler dialog box appears.
The left-most column in the Find Handler dialog box displays the name of each handler in
the movie. The middle column displays the number of the cast member associated with the
handler’s script, along with the name of that cast member. The rightmost column lists the cast
library that contains the cast member.
2
Select the handler that you want to find.
3
Click Find.
The handler appears in the Script window.
The title bar at the top of the Script window indicates the script’s type.
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
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...