Skip to main content
miquael
Inspiring
February 14, 2007
Answered

removeMovieClip

  • February 14, 2007
  • 2 replies
  • 473 views
how do i get a MC to remove itself? seems like this should be simple enough. i have a movie clip with a button within it. code on the button:

on(release) {
removeMovieClip(this);
}

or this?:

on(release) {
this.removeMovieClip();
}

or this?:

on(release) {
_parent.removeMovieClip();
}

nothing like this appears to work. i do not want to use a _root command.

can someone help?


This topic has been closed for replies.
Correct answer kglad
this.removeMovieClip() would work if your movieclip were at a removable depth. because you're having trouble i infer that your code is attached to a movieclip created in the authoring environment is therefore at depth -16000 or so.

removable depths are between 0 and 2^^20. to remedy use swapDepths() to move your movieclip to a removable depth and then execute your this.removeMovieClip().

2 replies

kglad
Community Expert
Community Expert
February 14, 2007
you're welcome.
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
February 14, 2007
this.removeMovieClip() would work if your movieclip were at a removable depth. because you're having trouble i infer that your code is attached to a movieclip created in the authoring environment is therefore at depth -16000 or so.

removable depths are between 0 and 2^^20. to remedy use swapDepths() to move your movieclip to a removable depth and then execute your this.removeMovieClip().
miquael
miquaelAuthor
Inspiring
February 14, 2007
thanks. that works!

i just fixed the depth at 1000 (it was previosly getNextHighestDepth):

this.attachMovie(item, "popup", 1000);