Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : Need help with going to a scene


Zorb
2/20/2004 8:58:34 PM
I know this is basic stuff, but it is driving me nuts as I can't figure out why
it doesn't work. :)
I have a movieclip (which has some buttons in it) loaded onto the stage. I
have assigned actionscript to a button in the movieclip, which when clicked on
should take the user to the next scene. However, it doesn't work.

If I place a button on the stage, it works, but as long as the button is
nested inside a movieclip, going to the next scene doesn't work.

I tried other methods instead, all of which also fail. One was to make another
movieclip (with a frame action to go to the next scene in the timeline) and put
that on the stage. I then made the button (in the original movieclip) to target
the 'jump' movie to play, which in theory would take me to the next scene. It
doesn't work either.

This is very annoying as I am fast approaching my deadline for completing this
work. I would appreciate any workarounds or solutions, maybe somebody has found
the same problem?

So, in a nutshell, I want to click on a button in a movieclip in one scene,
which will take me to the next scene.

Many thanks.
NSurveyor
2/20/2004 10:24:43 PM
I was thinking you could set for the button's action script:
on (release) {
passerby = 1;
}
And then on the Scene1 action script:
stop();
if (passerby == 1) {
gotoAndStop("Scene 2", 1);
}
I tried it, but with no luck. Maybe it'll work for you. And if it doesn't the
only solution I can come up with, is to copy all the frames into the Main movie
out of your movie lip. Just Ctrl-Alt-C Each layer and Ctrl-Alt-P it into Scene
1.
Jack.
2/21/2004 1:05:31 AM
without seeing any of the code you are using, this is a wild guess :)
are you using -
gotoAndStop("Scene 2", 1); ??
this code will fail if used from a movieclip.

for reliable navigation, add a frame label, say - sc2fr1, and use
_parent.gotoAndStop("sc2fr1");

hth ??
Zorb
2/21/2004 3:18:23 PM
Thanks for the info guys.
I will try these and see how it goes.

FWIW, I'm not using anything clever other than basic actionscripting, for
loading movieclips onto the stage, etc. I just want to be able to trigger going
to another scene from within a movieclip on the stage. I am stunned that this
doesn't work tbh. :(
Zorb
2/23/2004 10:23:01 AM
Thanks Jack. Your solution works.
AddThis Social Bookmark Button