I have a question regarding rollout buttons. I had gotten some code help a couple of weeks ago to make a menu rollout work. It is a Movie Clip and when the items inside that menu were clicked an image would load from an external movie. I am now trying to use that in a different setting, the difference being that now, I'd like to have the menu items go to and play a scene in the same movie. I have tried doing this and it simply will not work. The menu rolls out but the buttons do not load the scene. Is this because you cannot control the main movie timeline in a MC? And if so, is there a way around this or should I be setting up my rollout button differently from the beginning?
I'm not sure I fully understand what you're after but hope this helps anyway. Try posting your .fla up if this doesn't help.
If you want to control the main timeline from within a movieclip you will need to use something along the lines of:
Code:
on (press) {
_root.gotoAndPlay(frame number on root or frame label);
}
If you want to play a different scene on the root timeline, you need to put a frame label in the first frame of that scene, and use the code above but using the frame label, e.g.:
I tried adding your code to the second of the rollout buttons but I couldn't make it work I think I may have missed something along the way...I am going to attach my fla, if you could help me out, that would be fantastic.
I'm sorry, I'm not explaining myself well. I have only created the city2002 scene at the moment. So I have been using that as the test scene for both those buttons...the one that reads cityscapes 2003, is the one that has the code that you sent me on it. The one titled cityscapes2002 is the one that I had coded originally to load the scene externally.
I got your email address after I had posted my last reply and then I attached and sent you the zipped fla to that address.
it's ok, I think i'm probably just getting confused!
The code that I posted up in my last reply seems to work fine for going to another scene. Basically flash doesn't like targeting different scenes from inside an mc, so you have to target frame labels instead.
Is the code working for you, and how you wanted it to? Only, from what I understood of your original question, it seems to work fine.
I erased the code on the buttons and started again and I think that it is all working...one of the things that I didn't get was that I thought you would have to indicate somewhere what scene to go to to find the label in the code. Does _root cover the maintime line of all the scenes in your movie?
I have re-posted the functioning swf at the same link.
I think that everything is working ok. Thanks very much for your patience and your help. I really appreciate it. I have found Flashkit such an incredilble resource. It along with people like you have helped me so much along the way. I'm just starting my foray into learning more code, it's a little scary at times!!
Originally posted by Golnessa Does _root cover the maintime line of all the scenes in your movie?
All the scenes are contained on root, but for some reason the _root.gotoAndPlay("Scene", frame); code doesn't work from inside another movieclip. This is why the frame labels are used. That way flash will go straight to the scene in which the label is contained.
It can be confusing at times, which is why I tend not to use scenes where possible.
Only too glad to help, sorry for all the confusion!