This partial deletion of instances presents an interesting
possibility; it lets us maintain a generic container clip whose
contents can be repeatedly changed via loadMovie(
) and unloadMovie( ). For example, we
may quite legitimately invoke the following function series on an
instance called clipA (though in a real
application, these statements would include the appropriate preloader
code):
clipA.loadMovie("section1.swf"); // Load a document into clipA
clipA.unloadMovie( ); // Unload the document, leaving clipA intact
clipA.loadMovie("section2.swf"); // Load another document into clipA
One note of caution with this approach. When used on an instance,
unloadMovie( ) removes all custom properties of
the clip contained by the instance. Physical properties, such as
_x and _alpha persist, but
custom variables and functions are lost.