430
Chapter 12: Methods
nothing
Usage
nothing
Description
Command; does nothing. This command is useful for making the logic of an
if...then
statement more obvious. A nested
if...then...else
statement that contains no explicit
command for the
else
clause may require
else nothing
, so that Lingo does not interpret the
else
clause as part of the preceding
if
clause.
Parameters
None.
Example
The nested
if...then...else
statement in this handler uses the
nothing
command to satisfy
the statement’s
else
clause:
-- Lingo syntax
on mouseDown
if the clickOn = 1 then
if sprite(1).moveableSprite = TRUE then
member("Notice").text = "Drag the ball"
else nothing
else member("Notice").text = "Click again"
end if
end
// JavaScript syntax
function mouseDown() {
if (_mouse.clickOn == 1) {
if (sprite(1).moveableSprite) {
member("Notice").text = "Drag the ball";
} else {
// do nothing
}
} else {
member("Notice").text = "Click again";
}
}
This handler instructs the movie to do nothing so long as the mouse button is being pressed:
-- Lingo syntax
on mouseDown
repeat while the stillDown
nothing
end repeat
end mouseDown
// JavaScript syntax
function mouseDown() {
do {
// do nothing
} while _mouse.stillDown;
}
See also
if
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...