Skip to main content
July 2, 2007
Question

unloadMovieClip problem

  • July 2, 2007
  • 3 replies
  • 335 views
Hi.

I have a movieclip that contains a button. This movieClip is being duplicated a number of times. The button inside the movieclip contains the code attached below. When a button is pressed i need the movieClip to unload / be removed. For some reason, probably obviouse to everyone but me I cant manage to get the movieClip to unload.

Any advice / hacks at my code very welcome.

Thanks

Barry.

This topic has been closed for replies.

3 replies

kglad
Community Expert
Community Expert
July 2, 2007
you're welcome.
July 2, 2007
kglad.

Thanks, the following both work fine.

Barry.

xbtnBTN.onRelease = function() {

trace(this._parent+":"+this._parent.getDepth())

this._parent.swapDepths(2500);

this._parent.removeMovieClip();

}

xbtnBTN.onRelease = function() {
this._parent.removeMovieClip();
}
kglad
Community Expert
Community Expert
July 2, 2007
for your duplicated movieclips, you can use the following. for a movieclip created in the authoring environment you'll need to swap it into a depth that's removable with actionscript.