all groups > flash (macromedia) > december 2005 >
You're in the

flash (macromedia)

group:

How do I unload this movie clip??



How do I unload this movie clip?? natg504
12/22/2005 9:54:27 PM
flash (macromedia): 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);
}
Re: How do I unload this movie clip?? Michael Gioffredi
12/23/2005 6:52:01 PM
Do you want to unload them to clear up ram, or to just get rid of the images?
If it?s to clear up ram then yeah, you?ll have to get rid of each picture one
by one. However If you just want to remove them from the screen, then you can
just remove the movie clip they reside in.

I?m not exactly sure what you?re trying to accomplish with this. May I see the
effect? As you loop through each image in the xml file, you?re loading the
images into a clip called "parent". Because you?re using the same name for each
image, only the last image will show. The others will be deleted. Is this right?

AddThis Social Bookmark Button