User Guide
Global Functions 91
unloadMovie function
unloadMovie(target:MovieClip) : Void unloadMovie(target:String) : Void
Removes a movie clip that was loaded by means of loadMovie() from Flash Player. To unload
a movie clip that was loaded by means of
loadMovieNum(), use unloadMovieNum() instead
of
unloadMovie().
Availability: ActionScript 1.0; Flash Lite 1.1
Parameters
target - The target path of a movie clip. This parameter can be either a String (e.g.
"my_mc") or a direct reference to the movie clip instance (e.g. my_mc). Parameters that can
accept more than one data type are listed as type
Object.
Example
The following example creates a new movie clip called pic_mc and loads an image into that
clip. It is loaded using the MovieClipLoader class. When you click the image, the movie clip
unloads from the SWF file:
var pic_mcl:MovieClipLoader = new MovieClipLoader();
pic_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg",
this.createEmptyMovieClip("pic_mc", this.getNextHighestDepth()));
var listenerObject:Object = new Object();
listenerObject.onLoadInit = function(target_mc) {
target_mc.onRelease = function() {
unloadMovie(pic_mc);
/* or you could use the following, which refers to the movie clip
referenced by 'target_mc'. */
//unloadMovie(this);
};
};
pic_mcl.addListener(listenerObject);
See also
loadMovie (MovieClip.loadMovie method), unloadClip
(MovieClipLoader.unloadClip method)
unloadMovieNum function
unloadMovieNum(level:Number) : Void
Removes a SWF or image that was loaded by means of loadMovieNum() from Flash Player.
To unload a SWF or image that was loaded with
MovieClip.loadMovie(), use
unloadMovie() instead of unloadMovieNum().