# Where do I correctly place RemoveMovieClip?

**URL:** <https://forum.kirupa.com/t/where-do-i-correctly-place-removemovieclip/225027>\
**Category:** Uncategorized\
**Created:** [May 8, 2007, 6:52am UTC](https://forum.kirupa.com/t/where-do-i-correctly-place-removemovieclip/225027 "2007-05-08T06:52:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveg92656](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@daveg92656](https://forum.kirupa.com/u/daveg92656)\
**Post date:** [May 8, 2007, 6:52am UTC](https://forum.kirupa.com/t/where-do-i-correctly-place-removemovieclip/225027/1 "2007-05-08T06:52:27Z")

</div>

Using Flash 8;

Hey all,

I’m wondering where to correctly place “removeMovieClip/UnloadMovieClip”? My entire page lives in the first frame, so I can’t go to the last frame and call it.

First, I guess, do I need to use those calls? I have a photo gallery page, so when I load each .jpg into a container MC, do I then need to remove that same MC? Right now, I don’t do that and things seem fine (except for nesting, but that’s another issue).

If so, do I call “removeMC” in the “createMovieClip” function itself, at the end of the function? Do I call it from somewhere else?

Also, I have read I need to swapDepths. //my\_mc.swapDepths(666); // specify any available depth; before I call //my\_mc.removeMovieClip();

Here is my container code, below, where I load the .swf slideshow movies. Should I use “unloadMovie” here in each onRelease call to first load, the unload each movie?

///////  
var containerMC:MovieClip = \_root.createEmptyMovieClip(“photoMC”, \_root.getNextHighestDepth());  
photoMC.\_x = 120;  
photoMC.\_y = 150;

\_root.subCatMC1.onRelease = function(){  
// load mc1  
photoMC.loadMovie(“swf1.swf”);  
} //end on(Release)

\_root.subCatMC2.onRelease = function(){  
// load mc2  
photoMC.loadMovie(“swf2.swf”);  
} //end on(Release)

\_root.subCatMC3.onRelease = function(){  
photoMC.loadMovie(“swf3.swf”);

} //end on(Release)

\_root.subCatMC4.onRelease = function(){  
photoMC.loadMovie(“swf4.swf”);  
} //end on(Release)

my\_mc.swapDepths(666); // specify any available depth  
my\_mc.removeMovieClip();  
////////////////////////////

Thanks for your help!!
