User Guide

Chapter 21542
Controlling interaction between MIAWs
Movies can interact with each other by sending Lingo messages back and forth. This lets movies
share current values for variables, share information about current conditions, and send each
other Lingo instructions.
Global variables can be declared in the main movie (the Stage) or in a MIAW. No matter where
they are declared, they are available to the main movie and to all movies that are playing in
windows. For more information about global variables, see “Using global variables” on page 403.
At times, you might want only one movie to respond when the user clicks the mouse or types on
the keyboard. To control when Director can respond to any events that occur outside a window,
set the
modal window property. When a windows modal property is set to true, no other
window, including the Stage, can respond to events such as mouse clicks and keystrokes.
To have a MIAW send a Lingo statement:
Use the tell command. See tell in the Lingo Dictionary.
When using the
tell command, be sure to specify the MIAW to which the instructions are
directed. When you want a MIAW to send a Lingo message to the main movie, use
the stage to
refer to the main movie. For example, the statement
tell the stage to go to "Help"
instructs the main movie to go to the frame marked Help in the main movie.
To have a MIAW open another MIAW:
In Lingo, only the main movie (the Stage) can open a MIAW. Therefore, to have one MIAW
open another MIAW, you must use the tell command in the running MIAW to tell the Stage
to open another MIAW.
For example, this statement in a MIAW tells the Stage movie to open the movie menuMovie in its
own window:
tell the stage to open window "menuMovie"
See tell in the Lingo Dictionary.
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 “Movies in a Window” in the “Lingo by Feature” section of the Lingo Dictionary.