EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 160

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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"));
}

Related product manuals