164
Chapter 10: Events and Messages
Example
This handler plays a sound each time the user sends the projector to the background:
-- Lingo syntax
on deactivateApplication
sound(1).queue(member("closeSound"))
sound(1).play()
end
// JavaScript syntax
function deactivateApplication() {
sound(1).queue(member("closeSound"));
sound(1).play();
}
See also
add (3D texture)
,
activeCastLib
,
on deactivateWindow
on deactivateWindow
Usage
-- Lingo syntax
on deactivateWindow
statement(s)
end
// JavaScript syntax
function deactivateWindow() {
statement(s);
}
Description
System message and event handler; contains statements that run when the window that the movie
is playing in is deactivated. The
on deactivate
event handler is a good place for Lingo that you
want executed whenever a window is deactivated.
Example
This handler plays the sound Snore when the window that the movie is playing in is deactivated:
-- Lingo syntax
on deactivateWindow
sound(2).play(member("Snore"))
end
// JavaScript syntax
function deactivateWindow() {
sound(2).play(member("Snore"));
}
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...