
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
360
|
Chapter 13: Movie Clips
a main movie. Like unloadMovie(), removeMovieClip() can be used in both method
and global function form (though the syntax is different, the effect is the same):
removeMovieClip(theClip) // Global function
theClip.removeMovieClip() // Method
In the global function form of removeMovieClip(), theClip is a string indicating the
path to the clip to remove. Because movie clips are converted to paths when used as
strings,
theClip can also be a movie clip reference. In the method form of
removeMovieClip(),
theClip must be a reference to a movie clip object.
Unlike using unloadMovie(), deleting an instance via removeMovieClip() completely
obliterates the entire clip object, leaving no shell or trace of the clip and its proper-
ties. When we execute theClip.removeMovieClip(), future references to
theClip yield
undefined.
Removing Manually Created Instances Manually
Clip instances created manually in the Flash authoring tool have a limited life span—
they are removed when the playhead enters a keyframe that does not include them.
Hence, manually created movie clips live in fear of the almighty blank keyframe.
Remember that when a movie clip disappears from the timeline, it ceases to exist as a
data object. All variables, functions, methods, and properties that have been ...