Hi there,
I’d need a little bit of help here…
i have 3 scenes: loading, menu and animation.
when i’m playing the animation scene, i have a slider. I wanna use it as a on/off switch to go back to my scene “menu” so it goes like that:
the bouton (instance “onoff”) of my slider (on root of “animation”):
on (press) {
startDrag("_root.onoff", false, 50, 335, 120, 335);
}
on (release) {
stopDrag();
}
i have a movie clip also on root of “animation” that does a small loop between its frames 1 and 2 and i added the script:
z = _root.onoff._x;
if (z<60){
gotoAndPlay(“menu”,1);
}
frame 2 of that MC is just gotoAndPlay(1);
That doesn’t work. BUT if i try to control a MC with that code (instead of doing a jump to another scene), it works:
z = _root.onoff._x;
if (z<60){
_root.testmovieclip.gotoAndStop(2);
}
So my question is, why can it control a MC and not jump to a scene??
Since you wrote the following code INSIDE a movieclip:
if (z<60){
gotoAndPlay(“menu”,1);
}
It will try and gotoAndPlay a scene named “menu”, frame 1, from WITHIN the movieclip, and since there are no scenes in movieclips, Flash just won’t do anything, or will return an error.
You gotto understand that flash is built in “Tree” method, ie:
root
+movieclip
++symbolinsidemc
+anothermc
See that root is the mainstage, movieclip and anothermc are two symbols on the mainstage, and symbolinsidemc is another symbol inside the first movieclip, which is on the mainstage. Am I babbeling? :crazy:
what flatline meant to say is that you use [color=red]_root.gotoAndPlay (“menu”,1)[/color]
but for some strange reason if the script is in a mc inside another mc … it won’t work
you’ll need to use a frame label like this [color=red]_root.gotoAndPlay (“frameLabel”)[/color]
here’s the ‘tree’
_root
movie clip [color=red]_root.gotoAndPlay (“menu”, 1)[/color]
++ movie clip inside movie clip [color=red]_root.gotoAndPlay (“frameLabel”)[/color]
another mc [color=red]_root.gotoAndPlau (“menu”, 1)[/color]