Name

unloadMovieNum( ) Global Function — remove a movie from a document level

Availability

Flash 3 and later (Flash 5’s unloadMovieNum( ) function corresponds to Flash 3’s unload Movie, which worked only with numbered levels)

Synopsis

unloadMovieNum(level)

Arguments

level

A non-negative integer or an expression that yields a non-negative integer, indicating the document level to unload.

Description

The unloadMovieNum( ) function is nearly identical to unloadMovie( ) except that it requires the target level of the load operation to be specified as a number rather than as a string. This means that unloadMovieNum( ) can only remove movies on document levels, not movie clips. It is normally used when we wish to dynamically assign the level of a movie to unload, as in:

var x = 3;
unloadMovieNum(x);

This can also be achieved using string concatenation with the regular unloadMovie( ) function:

unloadMovie("_level" + x);

See Also

loadMovieNum( ), Movieclip.unloadMovie( ), unloadMovie( ); Section 13.6 in Chapter 13

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.