User Guide

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"));
}