![MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference Download Page 12](http://html1.mh-extra.com/html/macromedia/director-mx-2004-director-scripting/director-mx-2004-director-scripting_reference_3321720012.webp)
12
Chapter 2: Director Scripting Essentials
•
Properties are attributes that define an object. For example, a sprite in a movie has specific
attributes, such as how wide it is, how tall it is, its background color, and so on. To access the
values of these three specific attributes, you would use the Sprite object’s
width
,
height
, and
backColor
properties.
For more information on assigning properties to variables, see
“Storing and updating values in
variables” on page 21
.
•
Statements are valid instructions that Director can execute. All scripts are made up of sets of
statements. The following Lingo is a single complete statement.
_movie.go("Author")
For more information on writing script statements, see
“Scripting in dot syntax format”
on page 50
•
Variables are elements used to store and update values. Variables must start with a letter, an
underscore (
_
), or the dollar sign (
$
). Subsequent characters in a variable name can also be
digits (0-9). To assign values to variables or change the values of many properties, you use the
equals (
=
) operator.
For more information on using variables, see
“Variables” on page 21
.
Scripting syntax
The following are general syntax rules that apply to Lingo and JavaScript syntax.
•
Comment markers vary between Lingo and JavaScript syntax.
All Lingo comments are preceded by double hyphens (
--
). Each line of a comment that covers
multiple lines must be preceded by double hyphens.
-- This is a single-line Lingo comment
-- This is a
-- multiple-line Lingo comment
JavaScript syntax comments on a single line are preceded by a double-slash (
//
). Comments
that cover multiple lines are preceded with a
/*
and followed by a
*/
.
// This is a single-line JavaScript syntax comment
/* This is a
multiple-line JavaScript syntax comment */
You can place a comment on its own line or after any statement. Any text following the
comment markers on the same line are ignored.
Comments can consist of anything you want, such as notes about a particular script or handler
or notes about a statement whose purpose might not be obvious. Comments make it easier for
you or someone else to understand a procedure after you’ve been away from it for a while.
Adding large numbers of comments does not increase the size of your movie file when it is
saved as a compressed DCR or DXR file. Comments are removed from the file during the
compression process.
Comment markers can also be used to ignore sections of code you want to deactivate for
testing or debugging purposes. By adding comment markers rather than removing the code,
you can temporarily turn it into comments. Select the code you want to turn on or off, and
then use the Comment or Uncomment buttons in the Script window to quickly add or remove
comment markers.
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...