User Guide
Managing Memory 565
Preloading digital video
It is recommended that you do not preload digital video cast members. Digital video is played by
streaming the video file from a disk. As the file is streamed, it is decompressed into memory one
section at a time. Preloading a digital video file causes the entire file to be decompressed into
memory at once, which can cause low memory situations on most computers.
You can cause a digital video to preload only its first segment without consuming unnecessary
memory by placing it in the Score a frame or two before it is actually needed.
To preload a digital video safely:
1 Add a sprite of the digital video to the Score.
2 Begin the sprite one or two frames before the frame where you want to display the video.
3 Locate this sprite off the Stage except for at least one pixel of one corner of the sprite. This is so
the user won’t notice it.
4 Set the sprite’s movieRate property to 0, which prevents the movie from playing when
first loaded.
5 In the frame where you want the video to appear, use Lingo to set the sprite’s loc property to
place the sprite on the Stage in the location you select.
6 Set the movieRate property to 1 to start playing the video.
This way, the video will load its initial segment into memory and is ready to play immediately
when your movie reaches the frame where you want it to appear. Experiment with preloading the
video a few frames earlier if you find that preloading has not yet finished when your movie
reaches the frame where the video appears.