# How to "close" a drag-able window"

**URL:** <https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722>\
**Category:** flash\
**Created:** [March 27, 2003, 7:14pm UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722 "2003-03-27T19:14:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sentry43](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@Sentry43](https://forum.kirupa.com/u/Sentry43)\
**Post date:** [March 27, 2003, 7:14pm UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722/1 "2003-03-27T19:14:34Z")

</div>

I’m new to this…so forgive me.

I have at least figured out…😊 how to make a movie clip drag-able.  
The problem I’m having is how to close it…

In other words…I’ve got a frame…with some content…picture…some text. and a close button on it…all contained in a movie clip

but when I execute the program…the window drags around just fine…but I can’t click on the button…  
plus…what actions should the button have …to get rid of the movie clip…that it’s attached to?

Making sense?

Please help.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 27, 2003, 7:23pm UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722/2 "2003-03-27T19:23:35Z")

</div>

i’ll leave the specifics to the codemasters who roam around here,  
but I would think an unLoadMovie command on the button would  
do the trick. I could be wrong though.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 27, 2003, 8:15pm UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722/3 "2003-03-27T20:15:51Z")

</div>

That’s exactly how you would do it. You would load an external swf or a mc from your library and then unload it with the close button.

I guess another option you could use without unloading the mc is just using the \_visible = 0 property.

Look up the following terms in the actionscript dictionary

**Loads/unloads external swf to an empty mc**  
loadMovie  
unloadMovie

**Loads/unloads external swf to a level**  
loadMovieNum  
unLoadMovieNum

**Loads/unloads from library**  
attachMovie  
removeMovieClip

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 27, 2003, 8:34pm UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722/4 "2003-03-27T20:34:25Z")

</div>

ok…thanks for the responses…

but…I guess my problem is in the “construction” of the movie clip itself.

It’s simply a box…with a “X” in the top right corner.  
the “X” is a button.

My problem is: you can’t click on the “X”…the button simply doesn’t work.  
It’s like it doesn’t recognize it.

doesn’t the button and whatever else have to be in the actual movie clip? so it can all drag together?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 28, 2003, 1:24am UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722/5 "2003-03-28T01:24:26Z")

</div>

If your button is in a movieclip on the main tmeline use  
\_root.unloadMovie to control the main timeline…

What’s the url of what you have???

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 28, 2003, 1:26am UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722/6 "2003-03-28T01:26:21Z")

</div>

ok guys…I really need some help?

Please?

:sigh:

my problem…it seems…is…I create a movie clip…with a button on it…or whatever.  
That all works.  
But as soon as I give the movie clip the “onPress” “startDrag” option…my button…no longer seems to be a button…because it’s within the Movie clip?

I dunno…I’m new at this…

Please Help!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 28, 2003, 1:42am UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722/7 "2003-03-28T01:42:33Z")

</div>

gosh…I’m sorry…I’m new to this…and I know I’m not making any sense…

I simply want a draggable window…and to close it…the user would click…“close” or “an X”…that’s actually on the “window”.

the example I’ve got is VERY basic…a movie clip…that has the start drag thing on it…but…within the movie clip…is a button …to close it (the movie clip)…but…the button is not clickable.

I’m sorry…I’m probably not making any sense…

but I really need help

THANKS…SO VERY MUCH…:hair:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 28, 2003, 1:55am UTC](https://forum.kirupa.com/t/how-to-close-a-drag-able-window/16722/8 "2003-03-28T01:55:49Z")

</div>

i can’t open your file ☹

using mx
