Director Help

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

See also

activeWindow, close(), on deactivateWindow, frontWindow, on moveWindow, open() (Window)