# Closing?

**URL:** <https://forum.kirupa.com/t/closing/25519>\
**Category:** Uncategorized\
**Created:** [July 13, 2003, 10:45pm UTC](https://forum.kirupa.com/t/closing/25519 "2003-07-13T22:45:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![saint\_cleve](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@saint\_cleve](https://forum.kirupa.com/u/saint_cleve)\
**Post date:** [July 13, 2003, 10:45pm UTC](https://forum.kirupa.com/t/closing/25519/1 "2003-07-13T22:45:48Z")

</div>

i need some way that i can have one movie clip close when another one is loaded…any advice???

---

<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:** [July 13, 2003, 10:49pm UTC](https://forum.kirupa.com/t/closing/25519/2 "2003-07-13T22:49:21Z")

</div>

There’s an AS function called removeMovieClip() - if you use that inside the second clip, you should be able to delete the first one. 🙂

---

<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:** [July 13, 2003, 10:52pm UTC](https://forum.kirupa.com/t/closing/25519/3 "2003-07-13T22:52:10Z")

</div>

well…on my site…there is an option to close the movie clip, and when you click the close btn, there is a small animation closing it out…  
is there a way to have it when you open another movie clip, that the other one fineses playing out???..does that make sense???

---

<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:** [July 13, 2003, 11:01pm UTC](https://forum.kirupa.com/t/closing/25519/4 "2003-07-13T23:01:06Z")

</div>

Yeah. You just have to divide up each clip into sections, and use labels to name them. So the opening of a clip is labelled with ‘Start’ for example, and the closing animation frames are labelled ‘Close’.

On the button press, you use dot notation to target the opening and closing frames of the clips. So… [AS]on (press) {  
\_root.firstclip.gotoAndPlay(“start”);  
\_root.secondclip.gotoAndPlay(“close”);  
}[/AS]  
Along those lines. 🙂

---

<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:** [July 13, 2003, 11:01pm UTC](https://forum.kirupa.com/t/closing/25519/5 "2003-07-13T23:01:11Z")

</div>

What you’re asking about sounds a lot like a transition effect. Run a search for “transitions” in this section and you’ll find a bunch of threads on the subject. There’s even a tutorial for it as well so search around.

---

<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:** [July 13, 2003, 11:04pm UTC](https://forum.kirupa.com/t/closing/25519/6 "2003-07-13T23:04:03Z")

</div>

ok…but my each button is its own movie clip…

---

<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:** [July 13, 2003, 11:12pm UTC](https://forum.kirupa.com/t/closing/25519/7 "2003-07-13T23:12:39Z")

</div>

I’m not sure how your movieclips are setup but you can do something like this. First give your movieclips instance names like “movieclip1” and “movieclip2.”

Next apply a action like this to movieclip1:

```auto
on (release) {
	_root.movieclip1.gotoAndPlay("open");
	_root.movieclip2.gotoAndPlay("close");
}

```

Then on movieclip2 you would have the opposite:Next apply a action like this to movieclip1:

```auto
on (release) {
	_root.movieclip2.gotoAndPlay("open");
	_root.movieclip1.gotoAndPlay("close");
}

```

I’m not sure how your setup is like so this will not work unless you have frame labels placed where the open and close animations are in each movieclip. This is just to give you an idea as to how you could go about it.

---

<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:** [July 13, 2003, 11:20pm UTC](https://forum.kirupa.com/t/closing/25519/8 "2003-07-13T23:20:30Z")

</div>

another question…is there a script that i can use that when movie clip is opened, only the movie clip that is currently open will be closed???

kinda like:  
on (release) {  
\_root.movieclip1.gotoAndPlay(“open”);  
\_root.if\_open.movieclip2.gotoAndPlay(“close”);  
}

---

<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:** [July 14, 2003, 12:56am UTC](https://forum.kirupa.com/t/closing/25519/9 "2003-07-14T00:56:35Z")

</div>

store the names of your movieclip in an array:

```auto
myarray = []
myarray[0] = movie1
myarray[1] = movie2
myarray[2] = movie3

```

… when a window is opened, you loop through the array and close all the windows, and then open the one you just clicked

```auto
on (release) {
for(i=0; i<3; i++) _root[myarray*].gotoAndPlay("close");
_root.somemovieclip.gotoAndPlay("open");
}

```

---

<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:** [July 14, 2003, 4:03am UTC](https://forum.kirupa.com/t/closing/25519/10 "2003-07-14T04:03:45Z")

</div>

do you think you could explain in depth…how do i store movie clips in an array???
