-
Buttons open same mc, but link to different layers, can it be done???
I have 2 buttons on an interface, on the root timeline which play the same animation (of the interface disappearing) in a mc. But i would like to have them open they're 2 respective layers at the end of the animation.
ie one button could be to "Contact us" which would play the closing of the interface animation and then open up a layer on level 2 called contactus.swf
if you had pressed another button called "Portfolio" it would play the closing of the interface animation and then open up a layer on level 2 called portfolio.swf
(the reason im asking is because I'll have a lot more than 2 of these buttons happening and was wondering if i could use one animation rather than may duplicated versions of the same aniamtion)
thx in advance.
-
You want to use the same animation but load different swfs each time? On each of your buttons, put something like:
Code:
on(release) {
//change this var for each button (to the name of the respective .swf)
_root.toLoad = "contactus.swf";
gotoAndPlay("yourAnimation");
}
Then when your animation comes to the frame where you need to load the swf, do this:
Code:
loadMovie(_root.toLoad , targetMC);
-
hmmm, thats not running the animation in the mc, thus not getting to the loadMovie(_root.toLoad , targetMC);
-
Well don't use the code "gotoAndPlay("yourAnimation");" verbatim. You have to put in the path to the MC that you want to play depending on your MCs' instance names, e.g.
Code:
_root.mc1.mc2.gotoAndPlay(2);
...or however you have it set up.
-
ok i've got
on(release) {
_root.toLoad = "contact.swf";
_root.mc1.gotoAndPlay(2);
}
on my button, which is playing the animation now (thx)
but on the last frame inside the mc1, this code isnt opening the contact.swf on a new level
loadMovie(_root.toLoad , targetMC);
stop();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|