160
Chapter 10: Events and Messages
Example
This handler plays a sound each time the user brings the projector back to the foreground:
-- Lingo syntax
on activateApplication
sound(1).queue(member("openSound"))
sound(1).play()
end
// JavaScript syntax
function activateApplication() {
sound(1).queue(member("openSound"));
sound(1).play();
}
See also
on deactivateApplication
,
activeCastLib
,
on deactivateWindow
on activateWindow
Usage
-- Lingo syntax
on activateWindow
statement
(
s
)
end
// JavaScript syntax
function activateWindow()
statement
(
s
);
}
Description
System message and event handler; contains statements that run in a movie when the user clicks
the inactive window and the window comes to the foreground.
You can use an
on activateWindow
handler in a script that you want executed every time the
movie becomes active.
Clicking the main movie (the main Stage) does not generate an
on activateWindow
handler.
Example
This handler plays the sound Hurray when the window that the movie is playing in
becomes active:
-- Lingo syntax
on activateWindow
sound(2).play(member("Hurray"))
end
// JavaScript syntax
function activateWindow() {
sound(2).play(member("Hurray"));
}
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...