Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript language elements > Global Functions > 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 Player 3
target:Object - 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.
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);
loadMovie (MovieClip.loadMovie method), unloadClip (MovieClipLoader.unloadClip method)
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00001780.html