i need some way that i can have one movie clip close when another one is loaded…any advice???
There’s an AS function called removeMovieClip() - if you use that inside the second clip, you should be able to delete the first one.
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???
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.
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.
ok…but my each button is its own movie clip…
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:
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:
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.
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”);
}
store the names of your movieclip in an array:
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
on (release) {
for(i=0; i<3; i++) _root[myarray*].gotoAndPlay("close");
_root.somemovieclip.gotoAndPlay("open");
}
do you think you could explain in depth…how do i store movie clips in an array???