563
CHAPTER 24
Managing Memory
Macromedia Director MX 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
Lingo property. The default value of this property is 3. You can set this
property in Lingo 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-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...