I’m in a movie clip with buttons. The buttons start an animation that will play over top. The animation works. But I also want to go to a new scene (in the same swf) after that animation is finished.
So I have the following script attached to each of the buttons (inside an mc called “links”):
on (release) {
mynewscene = “studio”;
tellTarget ("_root.closemain") {
gotoAndPlay(“start”);
// plays animation (in mc closemain)
//and set variable of mynewscene
}
}
Currently I have the animation in another movie clip (called closemain) and the animation works. But, at the end of the animation (in closemain) I want to gotoandplay another scene.
I need to accomplish two things to do this.
I need to set the variable from whichever button was pressed (in my mc “links”) which I attempted to do in the code above with ‘mynewscene = “studio”’
And then after the animation (in the mc “closemain”) is finished I need to gotoandplay that scene (the scene indicated by the variable “mynewscene”. So the code at end of my animation in closemain looks like:
gotoAndPlay(“mynewscene”, 1);
Well, obviously this doesn’t work.
Two (and a half) questions:
Can I gotoandplay a scene from inside a movie clip (and, if so, how)?
how do I record my variable (mynewscene) from one movie clip and use that variable in another.
play a different mc (I know how to do this) and then
goto a frame (number or label) in a different scene
It’s the second part I don’t know how to do.
I need the entire mc to play before going to the new scene.
Can I add sequential actions to the original button?
Or can I add the script to the second mc to go to a frame in a different scene?
My project is finished except for this last mystery. And I would be ever-so grateful. I would put the answer up on my fridge and praise the person who solved this, my most recent bane.
I added the unique frameLabel to another scene, i.e., “startstudio”
and I made sure I spelled it right. And I added the code above
_root.gotoAndPlay(“startstudio”) to the end of the mc
and it’s not working.
So I tried just the code _root.gotoAndPLay (“startstudio”) to the original button thusly removing that extra step and it still didn’t work.
But I believe you. I believe that it should work. I believe that it usually works. I guess I’m that 1 out of 10 flashers who was unlucky.
But since I know that it should work and since I know that it works 9 times out of 10 I will play with this until it does work and thank you in advance for a solution that should sove all my problems. And eventually I will make it work. Thanks.
Please don’t mind the incredibly basic look, I just drew squares real quick because it focuses on how it works not how it should look
The black square it the button, the blue rectangle is the movie clip.
After you click the black square the blue rectangle will tween smaller then when it hits the end of the tween it will go to the frame label in the other scene.
Note: My file is Flash MX. Flash 5ers won’t be able to see it.
I have found that if you change the label and dont click on the stage, but instead just switch to the other scene it doesn’t register the frame label so you have to go back and re-enter it.