P. 1
Director 8

Director 8

|Views: 48|Likes:
Published by edmezz

More info:

Published by: edmezz on Feb 21, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/17/2012

pdf

text

original

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 202.

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

Writing Scripts with Lingo 185

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.

Also, note that literal strings are case sensitive. See “Writing strings” on page 202.

Comments

Comments in scripts are preceded by double hyphens (--). You can place a
comment on its own line or after any statement. Lingo ignores any text following
the double hyphen on the same line. For more information about comments in
Lingo, see “Troubleshooting Lingo” in the Director Support Center.

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.

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.

Optional keywords and abbreviated commands

You can abbreviate some Lingo statements. Abbreviated versions of a command
are easier to enter but may be less readable than the longer versions. The go
command is a good example. All the following statements are equivalent, but the
last one uses the fewest keystrokes.

go to frame "This Marker"
go to "This Marker"
go "This Marker"

It is good practice to use the same abbreviations throughout a movie so your
Lingo is easier to read.

Describing conditions

A script often needs to determine whether a certain condition exists before
carrying out a set of instructions. For example, a script may need to check
whether a network operation is finished before doing something that requires
the operation’s result.

The term TRUE or the number 1 indicates that the condition you’re testing for
exists. The term FALSE or the number 0 indicates that a condition doesn’t exist.

Chapter 6

186

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->