Using Director > Movies in a Window > Controlling events involving MIAWs |  |

Controlling events involving MIAWs

Lingo provides event handlers for typical events that can occur while a MIAW is playing, such as the movement of a window by the user. Such a handler is a good place for instructions that you want to run in response to an event that involves a window.

For example, to cause a sound to play whenever the user closes a MIAW, use the `queue()` and`play()` functions in an `on closeWindow` handler in a movie script within the movie that plays in the window. The `on closeWindow` handler will run whenever the MIAW that contains the handler closes.

See Movie in a window in the "Lingo by Feature" section in the Lingo Dictionary.