Indestructable movie clip

try as i might i can’t get this movie clip to remove. i’ve tried commanding it to remove from the main timeline and nothing happened. now i’ve attached this code to the clip itself and it still won’t go. it works fine for other clips in the movie:

onClipEvent (enterFrame) {

if (this._x<50) {
	this.removeMovieClip();
}
if (this._x>750) {
	this.removeMovieClip();
}
if (this._y<50) {
	this.removeMovieClip();
}
if (this._y>350) {
	this.removeMovieClip();
}

}

i’ve done this lots of time before and it worked fine. there must be something weird about the clip.

The only way you can use removeMovieClips is if you use duplicateMovieClips to make that movieCLip…

If you wanna get rid of a movieClip that you just had laying on the screen already… Use this._visible = false; That will make it invisible so you can’t see it anymore…

I hope this helped… Peace

yup, that must be it. that is indeed the only clip i had laying on the stage. didn’t realize that was a problem.

thanks!

No Problem Man…

Glad I could help :slight_smile:

removemovieclip works on any clip… any clip with a depth >= 0. clips placed on the stage manually have a negative depth, something around -16000. Because they have a negative depth, removemovieclip will not work with them. Attaching or duplicating a clip to a negative depth will also disable removemovieclip. With this being the case, all you need to do is use swapdepths on a movieclip to bring it too a depth >= 0 so it can be removed - and this accounts for all movieclips, even those manually placed on the screen in the Flash authoring environment. So to remove any clip use

myClip.swapDepths(0);
myClip.removeMovieClip();

Well that’s an easy way of knowing that…

Interesting too… But most movies you duplicate you make sure the depths are over 0 anyways… At least I always did… =)