Chapter 21
542
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 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
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.
Summary of Contents for DIRECTOR MX-USING DIRECTOR MX
Page 1: ...Using Director MX Macromedia Director MX...
Page 12: ...Contents 12...
Page 156: ...Chapter 4 156...
Page 202: ...Chapter 6 202...
Page 244: ...Chapter 7 244...
Page 292: ...Chapter 10 292...
Page 330: ...Chapter 12 330...
Page 356: ...Chapter 13 356...
Page 372: ...Chapter 14 372...
Page 442: ...Chapter 16 442...
Page 472: ...Chapter 18 472...
Page 520: ...Chapter 19 520...
Page 536: ...Chapter 20 536...
Page 562: ...Chapter 23 562...
Page 566: ...Chapter 24 566...
Page 602: ...Chapter 27 602...