Director Help

on activateApplication

Usage

-- Lingo syntax
on activateApplication
    statement(s)
end

// JavaScript syntax
function activateApplication() {
    statement(s);
}

Description

Built-in handler; runs when the projector is brought to the foreground. This handler is useful when a projector runs in a window and the user can send it to the background to work with other applications. When the projector is brought back to the foreground, this handler runs. Any MIAWs running in the projector can also make use of this handler.

During authoring, this handler is called only if Animate in Background is turned on in General Preferences.

On Windows, this handler is not called if the projector is merely minimized and no other application is brought to the foreground.

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