
437
CHAPTER 21
Managing Memory
Macromedia Director MX 2004 has effective built-in memory management that is sufficient for
most projects. To make memory available for new sprites, Director simply unloads the cast
members used for sprites that are no longer on the Stage. However, sometimes large cast
members, such as high resolution images, large sounds, or digital video, can take longer to load or
unload than typical, smaller cast members. When a cast member takes a lot of time to load or
unload, it can cause slight delays in movie playback.
If you test your movie on the lowest performance computers that you want it to be able to play
back on, you can determine whether any of these delays occur and make changes to correct them.
This chapter describes how Director’s memory management works and the steps you can take to
ensure smooth playback of movies with large amounts of media.
How Director unloads items from memory
To effectively manage memory while a Director movie is running, it is helpful to understand how
automatic unloading of cast members works in Director. By becoming familiar with this process,
you can make intelligent choices about when and how to perform memory management tasks
yourself, if necessary.
A cast member is automatically loaded into memory when Director needs to draw a sprite of it on
the Stage. Immediately after being drawn, each cast member is dealt with according to the value
of its
purgePriority
script property. The default value of this property is 3. You can set this
property in script or by selecting a number from the Unload menu in the Member panel in the
Property inspector while the cast member is selected in the Cast.
The following are the possible values for
purgePriority
:
•
When cast members with a purgePriority of 3 (normal) are no longer on the Stage, they can be
unloaded from memory whenever Director needs memory for other tasks.
•
Cast members with a purgePriority of 2 or 1 are only unloaded if memory is very low. They are
added to the top of a list of recently used cast members that Director stores internally. This list
is used to further prioritize cast members. Director assumes that the most recently used cast
members are most likely to be used again and unloads them from memory only after all cast
members with a
purgePriority
value of 3 are unloaded first.
•
Cast members with a purgePriority of 0 are left in memory, and are not added to the recently
used cast member list.
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...