
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 doesn’t 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 it’s 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 doesn’t consume memory until the movie is
reloaded. You might want to use this option if you don’t 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.
Содержание DIRECTOR MX 2004-USING DIRECTOR
Страница 1: ...DIRECTOR MX 2004 Using Director...
Страница 16: ...16 Chapter 1 Introduction...
Страница 82: ...82 Chapter 3 Sprites...
Страница 98: ...98 Chapter 4 Animation...
Страница 134: ...134 Chapter 5 Bitmaps...
Страница 242: ...242 Chapter 10 Sound and Synchronization...
Страница 274: ...274 Chapter 11 Using Digital Video...
Страница 290: ...290 Chapter 12 Behaviors...
Страница 302: ...302 Chapter 13 Navigation and User Interaction...
Страница 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Страница 392: ...392 Chapter 16 Working with Models and Model Resources...
Страница 418: ...418 Chapter 18 Movies in a Window...
Страница 446: ...446 Chapter 22 Managing and Testing Director Projects...