Using Director > Movies in a Window > Controlling interaction between MIAWs |  |

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 playing in windows. For more information about global variables, see Using global variables.

At times, you may 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 window's `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`.

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`.