MACROMEDIA DIRECTOR MX-USING DIRECTOR MX Use Manual page 391

Table of Contents

Advertisement

You can also use parentheses to override Lingo's order of precedence in math operations or to
make your Lingo statements easier to read.
For example, this math expression will yield a result of 13:
5 * 3 - 2
while this expression will yield a result of 5:
5 * (3 - 2)
Character spaces
Words within expressions and statements are separated by spaces. Lingo ignores extra spaces.
In strings of characters surrounded by quotation marks, spaces are treated as characters. If you
want spaces in a string, you must insert them explicitly.
You can see Lingo that uses strings in "Writing strings" on page 405.
Uppercase and lowercase letters
Lingo is not case-sensitive—you can use uppercase and lowercase letters however you want. For
example, the following statements are equivalent:
Set the hiLite of member "cat" to True
set the hilite of member "Cat" to True
SET THE HILITE OF MEMBER "CAT" TO TRUE
Set The Hilite Of Member "Cat" To True
However, it's a good habit to follow script writing conventions, such as the ones that are used in
this book, to make it is easier to identify names of handlers, variables, and cast members when
reading Lingo code.
Literal strings are case-sensitive. See "Writing strings" on page 405.
Comments
Comments in scripts are preceded by double hyphens (
line or after any statement. Lingo ignores any text following the double hyphen on the same line.
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.
Double hyphens can also be used to make Lingo ignore sections of code you want to deactivate
for testing or debugging purposes. By adding double hyphens 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 add or remove double
hyphens easily.
). You can place a comment on its own
--
Writing Scripts with Lingo 391

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director mx

Table of Contents