# Another easy one about movie clips

**URL:** https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511
**Category:** flash
**Created:** [July 13, 2004, 9:25pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511 "2004-07-13T21:25:58Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![jedinitex](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jedinitex](https://forum.kirupa.com/u/jedinitex)
#### Post date: [July 13, 2004, 9:25pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/1 "2004-07-13T21:25:58Z")

</div>

Ok, I have it to where when you click on a button, a movie clip gets loaded into a certain position. I have another button that does the same thing. But for some reason, both movie clips won’t stay open at the same time. It’s like I can have one or the other. What’s wrong? 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: [July 13, 2004, 9:40pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/2 "2004-07-13T21:40:09Z")

</div>

nevermind, i figured that one out, but i do have another question. how do i get it so that the button they clicked on to load the movie clip, if they click it again, it unloads the 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 14, 2004, 3:05am UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/3 "2004-07-14T03:05:35Z")

</div>

set up a variable in the timeline:  
clickN=0;

for the button AS:  
on(release){  
if(clickN==0){  
container.loadMovie(“movie.swf”);  
clickN+=1;}

else if(clickN!=0){  
container.unloadMovie(“movie.swf”);  
clickN-=1;  
}  
}

---

<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, 2004, 2:41pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/4 "2004-07-14T14:41:53Z")

</div>

how would the code be different if i’m not using an external swf file, but a movie clip within the library and i’m using attachmovie?

---

<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, 2004, 2:55pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/5 "2004-07-14T14:55:16Z")

</div>

hmm. i’ve never used attachMovie, but i’m thinking removeMovieClip will work…  
[http://www.macromedia.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary631.html](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary631.html)

---

<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, 2004, 6:00pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/6 "2004-07-14T18:00:06Z")

</div>

awesome, it works 🙂 thanks! I have another question though. When you push a button, a movie clip plays that displays a window (it’ll have some text in it probably). Now, there are probably going to be at least three of these windows. What I want is when you click a button, the corresponding window goes to the next available spot. If no window is open yet, the first button (could be any of the three) they push will open the window in the first spot, etc. I hope that kinda makes 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 14, 2004, 6:35pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/7 "2004-07-14T18:35:46Z")

</div>

so are you saying you would have 3 empty containers to start and then each button would load a windowMC? but you want the windowMC to load into the next available empty container?

---

<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, 2004, 7:35pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/8 "2004-07-14T19:35:50Z")

</div>

i don’t have containers, i just want them to load into the next available spot (leftmost position)

---

<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, 2004, 8:29pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/9 "2004-07-14T20:29:48Z")

</div>

i’m thinking you’re going to have to use container MC’s to load them into. that way you can call it by it’s instance name and use the \_x property. then you could use if statements to set up conditions in which you would attach an MC into a certain x location.

---

<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, 2004, 10:58pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/10 "2004-07-14T22:58:49Z")

</div>

i have no idea how to do that. what are containers? just blank movie clips to load things into? how do i do that?

---

<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, 2004, 11:04pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/11 "2004-07-14T23:04:53Z")

</div>

yeah, that’s what containers are. just goto Insert\>new symbol\>mc. then don’t put anything in it. go to the main timeline and put the movieclip in there. give it the instance name container.

---

<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, 2004, 11:12pm UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/12 "2004-07-14T23:12:29Z")

</div>

ok, but i have no idea what to do once i get that done ☹ i’m kinda confused

---

<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 15, 2004, 2:18am UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/13 "2004-07-15T02:18:34Z")

</div>

[font=Comic Sans MS]i’m confused on how i load them once i have the containers[/font]

---

<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 15, 2004, 2:29am UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/14 "2004-07-15T02:29:37Z")

</div>

i’m making a fla, i’ll attach it in a short bit.

---

<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 15, 2004, 3:41am UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/15 "2004-07-15T03:41:23Z")

</div>

ok, made a zip file. took a little longer than i thought it would, but such is life. it was an interesting challenge. i think this is what you were describing…

[http://www.haveri-media.com/loadingMC.zip](http://www.haveri-media.com/loadingMC.zip)

---

<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 15, 2004, 4:13am UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/16 "2004-07-15T04:13:32Z")

</div>

your example is exactly what i’m looking for. i don’t have time at the moment to try and implement it but i will shortly. Thanks so much! I’ll get back to you and let you know how it turns out. Thanks again!

---

<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 15, 2004, 4:38am UTC](https://forum.kirupa.com/t/another-easy-one-about-movie-clips/57511/17 "2004-07-15T04:38:18Z")

</div>

no problem. good luck w/that.
