Flash Question - help!
- Started
- Last post
- 8 Responses
- shtuker
Something I've always wondered about, but have never known how to do. Any help is much appreciated:
You want a movie clip to go away when another navigation link is clicked - but only if it's already opened. For instance: I want to hit "about" and have whichever clip that is open to go away. How do I tell flash to locate and close (more specifically - play the closing animation for...) whichever link is "open"?
I asked this question before, but didn't get a helpful response. Thanks for any help.
- K_Fresh0
Ummm...did you try putting an Unload Movie action on the buttons?
- shtuker0
An unload movie action won't tell an open clip to play through a closing animation sequence - if it's the one that's open.
help.
- shant0
use variables. when you click the button, set a variable thats equal to the name of the next clip you want to open, and tell the open clip to play out.
then on the last frame of the out sequence, make the next clip open using the variaable that was set.
make sense?
- shtuker0
Shant... I'm a bit of a novice. Could you be more specific about the variables? An example, perhaps?
Thanks.
- _b_0
function openClipIfNotAlreadyOpen(clip)
{
if (clip != _root.currentClip)
{
_root.currentClip.gotoAndPlay("c...
clip.gotoAndPlay("open");
_root.currentClip = clip;
}will need adjusting if you want the clip closing to finish and dissapear before the new clip starts up, you should be able to figure that out?
- dsmith70
Variables 101
http://www.actionscripts.org/tut…
I have done exactly what you want to do numerous times. You _will_ have to use variables to do it easily. Trust me, once you understand variables a whole new world of actionscripting possibilities comes alive.
- shtuker0
This is very good info. Thanks a lot guys. I think I have something to work with.
- autonoma0
This is one way to do it.
Say you have clipOne and clipTwo on the _root timeline. Inside of each of these rests a button. You would put something like this on clipOne's button:
on (press) {
if (_root.clipTwo.open = true) {
_root.clipTwo.gotoAndPlay('endSe...
gotoAndPlay('openingSequence');
_root.clipTwo.open = false;
open = true;
} else {
gotoAndPlay('openingSequence');
}
}