![MACROMEDIA DIRECTOR MX 2004 Reference Download Page 209](http://html1.mh-extra.com/html/macromedia/director-mx-2004/director-mx-2004_reference_687516209.webp)
if
209
See also
showGlobals()
,
property
,
gotoNetMovie
if
Usage
if
logicalExpression
then
statement
if
logicalExpression
then
statement
else
statement
end if
if
logicalExpression
then
statement(s)
end if
if
logicalExpression
then
statement(s)
else
statement(s)
end if
if
logicalExpression1
then
statement(s)
else if
logicalExpression2
then
statement(s)
else if
logicalExpression3
then
statement(s)
end if
if
logicalExpression1
then
statement(s)
else
logicalExpression2
end if
Description
Keyword;
if...then
structure that evaluates the logical expression specified by
logicalExpression
.
•
If the condition is
TRUE
, Lingo executes the statement(s) that follow
then
.
•
If the condition is
FALSE
, Lingo executes the statement(s) following
else
. If no statements
follow
else
, Lingo exits the
if...then
structure.
•
All parts of the condition must be evaluated; execution does not stop at the first condition that
is met or not met. Thus, faster code may be created by nesting
if...then
statements on
separate lines instead of placing them all on the first line to be evaluated.
When the condition is a property, Lingo automatically checks whether the property is
TRUE
. You
don’t need to explicitly add the phrase
= TRUE
after the property.
The
else
portion of the statement is optional. To use more than one
then-statement
or
else-statement
, you must end with the form
end if
.
The
else
portion always corresponds to the previous
if
statement; thus, sometimes you must
include an
else nothing
statement to associate an
else
keyword with the proper
if
keyword.
Note:
A quick way to determine in the script window if a script is paired properly is to press Tab. This
forces Director to check the open Script window and show the indentation for the contents. Any
mismatches will be immediately apparent.
Summary of Contents for DIRECTOR MX 2004
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...