Chapter 16
392
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.
Writing Lingo statements
When you are writing statements in a Lingo script, you can choose between two types of syntax:
verbose syntax and dot syntax.
Verbose syntax
Verbose syntax is similar to English. Because of this, verbose syntax is an excellent way to learn to
program for the first time: as a new programmer, you can read verbose Lingo and get a fairly good
idea of what it is doing. Most users will start out writing Lingo exclusively with verbose syntax
because it is so easy to understand.
Here are three examples of verbose Lingo that is very English-like and has a literal meaning:
set the stageColor to 255
put the text of member "Instructions" after member "Introduction"
if x=5 then
go to frame 22
end if
Almost all of Lingo’s functionality is available through verbose syntax, but there are a few
exceptions. Most of these exceptions are found in Lingo used for manipulating text.
The disadvantage of verbose Lingo is that it can quickly become very long when you write
complex scripts. Longer scripts are harder to read and debug. Once your scripts reach a certain
level of complexity, you may find it easier to use dot syntax.
For several examples that compare verbose and dot syntax, see the next section.
Summary of Contents for DIRECTOR MX-USING DIRECTOR MX
Page 1: ...Using Director MX Macromedia Director MX...
Page 12: ...Contents 12...
Page 156: ...Chapter 4 156...
Page 202: ...Chapter 6 202...
Page 244: ...Chapter 7 244...
Page 292: ...Chapter 10 292...
Page 330: ...Chapter 12 330...
Page 356: ...Chapter 13 356...
Page 372: ...Chapter 14 372...
Page 442: ...Chapter 16 442...
Page 472: ...Chapter 18 472...
Page 520: ...Chapter 19 520...
Page 536: ...Chapter 20 536...
Page 562: ...Chapter 23 562...
Page 566: ...Chapter 24 566...
Page 602: ...Chapter 27 602...