Director Help

on zoomWindow

Usage

-- Lingo syntax
on zoomWindow
    statement(s)
end

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

Description

System message and event handler; contains statements that execute whenever a movie running as a movie in a window (MIAW) is resized. This happens when the user clicks the Minimize or Maximize button (Windows) or the Zoom button (Mac). The operating system determines the dimensions after resizing the window.

An on zoomWindow event handler is a good place to put Lingo that rearranges sprites when window dimensions change.

Example

This handler moves sprite 3 to the coordinates stored in the variable centerPlace when the window that the movie is playing in is resized:

-- Lingo syntax
on zoomWindow
    centerPlace = point(10, 10)
    sprite(3).loc = centerPlace
end

// JavaScript syntax
function zoomWindow() {
    var centerPlace = point(10, 10);
    sprite(3).loc = centerPlace;
}

See also

drawRect, sourceRect, on resizeWindow