User Guide

Opening and closing a MIAW 411
To open a MIAW:
Use the following script:
-- Lingo
window().new("movieName")
window("movieName").open()
-or-
window().new("movieName").open()
// JavaScript syntax
new window("movieName");
window("movieName").open();
-or-
new window("movieName").open();
Unless you explicitly preload the movie through scripting, Director doesnt load the movie into
memory until the window is opened, which can cause a noticeable pause. To load the first frame
of the movie, use the
preLoadMovie method.
You can specify other window characteristics before or after you open the window and by using
the Display Template at authoring time. For more information, see Window appearance
properties” on page 413.
Closing a MIAW
You can close the window for a MIAW but leave the movie in memory, or you can close the
MIAW and remove the movie from memory when its no longer in use.
If you leave a MIAW in memory, you get better performance if the window is reopened;
however, the movie still consumes memory. You might want to use this option if you expect
a MIAW to be reopened after it initially runs, or if other windows or global variables refer to
the MIAW.
If you remove a MIAW from memory, performance slows down if the window is reopened
because the movie has to reload; however, it doesnt consume memory until the movie is
reloaded. You might want to use this option if you dont expect a MIAW to be reopened after it
initially runs or if you want to optimize memory on the computer running the MIAW.
To close a MIAW but keep it in memory:
Use the close() method. After the window is closed, the window becomes invisible, but the
movie continues playing. (You can also still access it in the
windowList.) For example,
window("window name").close().
To close a MIAW and remove it from memory:
Use the forget() method. The window is closed, and the movie is removed from memory.
Use this method only if no other window or global variables still refer to the MIAW. When you
remove a MIAW from memory, it is no longer available in the windowList. For example,
window("window name").forget(). For more information about this method, see the
Scripting Reference topics in the Director Help Panel.