Close swf

how do i close a swf. within the swf. For example: I have a button inside the movieclip with an X, when someone clicks it, I want the moveclip to close.

You could:


on(release){
_root.movieClip.removeMovieClip();
}

or you could have an empty keyframe somewhere on the movieClip’s timeline and do a


on(release){
_root.movieClip.gotoAndStop("emptyPart");
//make sure you have an empty frame called emptyPart
}

and I think you could do this:


on(release){
_root.movieClip._visible = false;
}

See if those work…(-:

Also keep in mind that removeMovieClip(); only works if that movie clip was created with attachMovieClip(); or createMovieClip();

It will not work with a movieclip that’s already created on stage.

Really? I didn’t know that - sorry…I use that with duplicateMovieClip() as well. Thanks EG.

oops I forgot about duplicateMovieClip();. Basically it won’t work with a movieclip that was manually created.

Thanks guys

Originally posted by electrongeek
**Also keep in mind that removeMovieClip(); only works if that movie clip was created with attachMovieClip(); or createMovieClip();

It will not work with a movieclip that’s already created on stage.**

That’s not true… :wink:

Senocular has explained it many times, but this was the first thread I found. :stuck_out_tongue:
http://www.kirupaforum.com/forums/showthread.php?s=&postid=201160#post201160

:wink:

you can read more about depths and movieclips (and things of the such) here
http://www.umbc.edu/interactive/flash/tutorials/showpage.php?p=depths