![MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING Reference Download Page 210](http://html1.mh-extra.com/html/macromedia/director-mx-2004-director-scripting/director-mx-2004-director-scripting_reference_3321720210.webp)
210
Chapter 11: Keywords
Example
This statement checks whether the carriage return was pressed and then continues if it was:
if the key = RETURN then go the frame + 1
This handler checks whether the Command and Q keys were pressed simultaneously and, if so,
executes the subsequent statements:
on keyDown
if (_key.commandDown) and (_key.key = "q") then
cleanUp
quit
end if
end keyDown
Compare the following two constructions and the performance results. The first construction
evaluates both conditions, and so must determine the time measurement, which may take a while.
The second construction evaluates the first condition; the second condition is checked only if the
first condition is
TRUE
.
spriteUnderCursor = rollOver()
if (spriteUnderCursor > 25) and MeasureTimeSinceIStarted() then
_player.alert("You found the hidden treasure!")
end if
The alternate, and faster, construction would be as follows:
spriteUnderCursor = rollOver()
if (spriteUnderCursor > 25) then
if MeasureTimeSinceIStarted() then
_player.alert("You found the hidden treasure!")
end if
end if
See also
case
INF
Usage
-- Lingo syntax
INF
Description
Return value; indicates that a specified Lingo expression evaluates as an infinite number.
See also
NAN
item...of
Usage
-- Lingo syntax
t
extMemberExpression
.item[
whichItem]
item
whichItem
of
fieldOrStringVariable
textMemberExpression
.item[
firstItem..lastItem]
item
firstItem
to
lastItem
of
fieldOrStringVariable
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...