EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Unloadmovienum Function

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Global Functions 111
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().
Availability: ActionScript 1.0; Flash Player 3
Parameters
level:Number - The level (_level N ) of a loaded movie.
Example
The following example loads an image into a SWF file. When you click
unload_btn, the
loaded content is removed.
loadMovieNum("yourimage.jpg", 1);
unload_btn.onRelease = function() {
unloadMovieNum(1);
}

Table of Contents

Related product manuals