Another easy one about movie clips

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!

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?

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;
}
}

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?

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

awesome, it works :slight_smile: 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.

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?

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

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.

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

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.

ok, but i have no idea what to do once i get that done :frowning: iā€™m kinda confused

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

iā€™m making a fla, iā€™ll attach it in a short bit.

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

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!

no problem. good luck w/that.