Writing scripts in the Script window
81
To cycle through the scripts in the Script window:
•
Use the Previous Cast Member and Next Cast Member arrows at the top of the Script window
to advance or back up to a script.
To duplicate a script:
•
Select the script in the Cast window and select Duplicate from the Edit menu.
To create a script that is attached automatically to every sprite made from a specific cast member,
attach the script to the cast member itself.
To create a script attached to a cast member or open an existing one, do one of the
following:
•
Right-click (Windows) or Control-click (Macintosh) on a cast member in the Cast window
and select Cast Member Script from the context menu.
•
Select a cast member in the Cast window and then click the Cast Member Script button in the
Cast window.
Using linked scripts
In addition to scripts stored as internal cast members, you can choose to keep scripts in external
text files and link them to your Director movie. These linked scripts are similar to linked image or
digital video files that you can import into Director movies.
Advantages of using linked scripts include the following:
•
One person can work on the Director file while another works on the script.
•
You can easily exchange scripts with others.
•
You can control the scripts separately from the Director file in a source code control
application such as Microsoft Visual SourceSafe or Perforce by Perforce Software. Applications
such as this prevent multiple programmers working on the same Director project from
overwriting each other’s work.
Linked scripts are used by Director only during authoring. At runtime, Director projectors and
Macromedia Shockwave Player use a special internal copy of the script data stored in the movie.
This way, your linked scripts need not be distributed with your movies and cannot be copied by
end users.
To import a script as a linked text file:
1
Select File > Import.
2
Select Script as the type of file to import.
3
Select the script file(s) you want to import.
You can import files with the file extensions
.
txt, .ls, or .js. The .ls extension is the Director
linked script extension.
To create a list of files you want to import, you can use the Add and Add All buttons. This is
especially useful if you want to import scripts from multiple locations.
4
Select Link to External File from the Media pop-up menu.
5
Click Import.
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...