PDA

View Full Version : Newbie Goto Scene Question


EyesOnly
05-13-2002, 06:03 PM
Hi,
I'm having a problem with Flash scripting. It's difficult to explain due to the terminology involved. When I create a Movie Clip within the Main Movie and then put a bottom in it the scripting I apply to that button, in this case the "Goto and play" command only seems to apply within that Movie Clip and not within the Main Movie.

For example if in inside a Movie Clip I place a button and say

On Press
Goto and Play
Scene 3 Frame 1

It tries (I think) to go to Scene 3 within the Movie Clip. Just makes the screen blank. I would use the telltarget or the with command but they require you specify an object. What do I specify for the Main Movie itself?

I know I havnt't made that staggeringly clear but any help appreciated.

Thanks

thegermster
05-13-2002, 06:17 PM
Hi EyesOnly,
Welcome to Flashmove! You are right. When you have actionscript commands in a MC, that scripting applies to the MC that contains it. If you had a MC (instance name 'MC1') on the main stage area, and you put commands in the MC, then you would use '_root' to reference the main stage area.
Example:
on (release) {
_root.gotoAndPlay(1);
}
This would start your main movie all over again. Just change the frame number to correspond to what you want to do. If you had another MC (instance name 'MC2') that was on the main stage area, and you wanted to control that from a button in MC1 then you would use this code:
on (release) {
_root.MC2.gotoAndPlay(1);
}
When it comes to scenes .... it's a very popular opinion to avoid them altogether. When you use a button to change between scenes, it will only work if your button is on the main stage area. Flash just doesnt like scenes for some reason. There are a couple of ways to cheat around this problem, but it is much better to put everything on one scene and use frame labels to show where your different pages start and end. Does this make sense?

EyesOnly
05-13-2002, 07:08 PM
Hey thanks a lot thats exactly what I was looking for.

Your right I'll try not use scenes as they seem to be a sort of "after thought" for the Macromedia team that they threw in at the last second.

Thanks for all your help.
EyesOnly