188
Chapter 10: Events and Messages
Example
This handler displays a message in the Message window when the window a movie is playing
in moves:
-- Lingo syntax
on moveWindow
put("Just moved window containing" && _movie.name)
end
// JavaScript syntax
function moveWindow() {
put("Just moved window containing " + _movie.name);
}
See also
activeWindow
,
name (3D)
,
windowList
on openWindow
Usage
-- Lingo syntax
on openWindow
statement(s)
end
// JavaScript syntax
function openWindow() {
statement(s);
}
Description
System message and event handler; contains statements that run when Director opens the movie
as a movie in a window and is a good place to put Lingo that you want executed every time the
movie opens in a window.
Example
This handler plays the sound file Hurray when the window that the movie is playing in opens:
-- Lingo syntax
on openWindow
sound(2).play(member("Hurray"))
end
// JavaScript syntax
function openWindow() {
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...