I loaded a movieclip with the following code. How can I unload it when i move to a different frame? Do I have to loop through all the xml images again & use UnloadClip or is there a better way?
StencilGalleryXML = new XML();
StencilGalleryXML.onLoad = init;
StencilGalleryXML.load("stencils.xml");
StencilGalleryXML.ignoreWhite = true;
var MCL = new MovieClipLoader();
function init(success) {
if (success == true) {
imgDesc = "";
rootNode = StencilGalleryXML.firstChild;
nbrStencils = rootNode.childNodes.length;
currentStencil = rootNode.firstChild;
for (i=0; i<nbrStencils; i++) {
mcName = "stencil"+i;
loadImage(currentStencil.attributes.swfURL, mcName, currentStencil.firstChild.nodeValue, i+1);
currentStencil = currentStencil.nextSibling;
}
}
}
function loadImage(imgSrc, clipName, desc, ctr) {
this.createEmptyMovieClip("parent", this.getNextHighestDepth());
newClip = parent.createEmptyMovieClip(clipName, this.getNextHighestDepth());
newClip.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
MCL.loadClip(imgSrc, newClip.container_mc);
}
StencilGalleryXML = new XML();
StencilGalleryXML.onLoad = init;
StencilGalleryXML.load("stencils.xml");
StencilGalleryXML.ignoreWhite = true;
var MCL = new MovieClipLoader();
function init(success) {
if (success == true) {
imgDesc = "";
rootNode = StencilGalleryXML.firstChild;
nbrStencils = rootNode.childNodes.length;
currentStencil = rootNode.firstChild;
for (i=0; i<nbrStencils; i++) {
mcName = "stencil"+i;
loadImage(currentStencil.attributes.swfURL, mcName, currentStencil.firstChild.nodeValue, i+1);
currentStencil = currentStencil.nextSibling;
}
}
}
function loadImage(imgSrc, clipName, desc, ctr) {
this.createEmptyMovieClip("parent", this.getNextHighestDepth());
newClip = parent.createEmptyMovieClip(clipName, this.getNextHighestDepth());
newClip.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
MCL.loadClip(imgSrc, newClip.container_mc);
}