There are a number of solutions. On the buttons, you can use any of the
following code examples:
1.
on (release) {
gotoAndPlay("Scene name",1);
// Replace "Scene name" with the name of your scene
}
2.
on (release) {
nextScene();
//or prevScene(); depending on which direction you want to go
}
3.
on (release) {
gotoAndPlay(#);
}
Example 3 needs a bit more explanation. If you're experiencing
difficulty with examples 1 and 2, you will need to use absolute frame
references in example 3.
Your scenes, laid side to side, form one long timeline and despite the
fact that each scene starts at frame 1, all the frames are ultimately
added together into one timeline by the player.
For example, if you have 3 frames in scene 1, scene 2 will begin at
frame 4 (relative to scene 1).
Negative numbers, or numbers beyond the total frame count of your movie
cause the player to restart at the beginning.
Therefore, use absolute frame references to either skip forward scenes
or to restart the movie. I usually reserve this as a last resort when
examples 1 and 2 fail to work for whatever reason.
Regards,
Patrick
[quoted text, click to view] kaihea wrote:
> Please, please help! What's the actionscript look like to use a button to navigate between scenes?
>
> Thank you!
> Kaihea
[quoted text, click to view] NSurveyor wrote:
> on (release) {
> gotoAndStop("SCENE NAME", 1);
> }
Actually that would not be correct.
Widely discuss on this macromedia.flash forum number of times in past many years that
scenes are Only for authoring purpose , they are not included
in final SWF files . Your movie become one long timeline once exported
and Scene basically are to give an end to one and beginning to another timeline .
That's why you can't target them in your actions.
Plus, if scene 1 has 100 frames and scene 2 has 100, the frame 10 in scene two become
actually frame 110. Using scene go to frame 1 will return to the first frame of the timeline
not scene.
Labels are what you need to use
Attach unique label to first frame of scene you like to target and use
_root.gotoAndPlay("label");
We have discussed that literally thousand of times, please , in the future search the forum archives
prior to posting.
--
Regards
urami_*
<hol>
http://flashfugitive.com/ </hol>
By The way:
If you try to mail me , DO NOT *laugh*