on (release) {
_level1.nextScene();
}
What’s wrong with this code? My movie doesn’t do anything when you click the button that has this code. It just sits there. And yes, I do have several scenes.
on (release) {
_level1.nextScene();
}
What’s wrong with this code? My movie doesn’t do anything when you click the button that has this code. It just sits there. And yes, I do have several scenes.
well for starters it’s telling level1 to go there
second is that you should put a new layer called "labels"
and use this with gotoAndPlay(“labelyouused”);
scene don’t exist in published movies
What? :huh: I can’t understand. You don’t use good grammar.
so I missed an s on scene(s) SOOOORYYYY!!!
READ THIS THEN:
This is straight from the documentation:
gotoAndPlay()
usage: gotoAndPlay([scene,] frame)
MovieClip.gotoAndPlay()
usage: my_mc.gotoAndPlay(frame)
So you see, Movieclip.gotoAndPlay does NOT have a scene parameter. Hence, if you are inside a movieclip and trying to reach the first frame in Scene 1, using _root.gotoAndPlay(“Scene 1”, 1) just won’t work. It’s essential to understand that scenes are not exported in the swf. All scenes are put one after the other to create a single scene when publishing to swf, much like layers. If you use gotoAndPlay with the scene parameter, when you publish your file, the IDE compiler will catch these calls and converts them to standard gotoAndPlay calls without the scene parameter.
For example, if you have two scenes called Scene 1 and 2, both having 10 frames, and you use gotoAndPlay(“Scene 2”, 5), the compiler simply translates it to gotoAndPlay(15). If you want to use that call inside of a movieclip, simply use _root.gotoAndPlay(15). This goes for gotoAndStop as well. You may also use frame labels, as they also work well.
I’m not using this code on a movie clip symbols. _level1 is the name of the level; it is not the name of one of my movie clip symbols.
So what do you think I should do? I have a “fast forward” button on level0. If a user clicks it, then it will play the next scene on level1. I don’t want some complicated actionscript that uses a bunch of frame names, because I have A LOT of scenes. I just want to use nextScene somehow.
Why did Macromedia put in nextScene(); if scenes don’t exist in the published movie?
For example, if you have two scenes called Scene 1 and 2, both having 10 frames, and you use gotoAndPlay(“Scene 2”, 5), the compiler simply translates it to gotoAndPlay(15). If you want to use that call inside of a movieclip, simply use _root.gotoAndPlay(15). This goes for gotoAndStop as well. You may also use frame labels, as they also work well.
[SIZE=7]It’s essential to understand that scenes are not exported in the swf.[/SIZE]
Why did Macromedia put in nextScene(); if scenes don’t exist in the published movie?
I don’t know…not my problem though
Well, if i remember correctly, scenes can only be activated through the _root timeline. So any code that points to anywhere else other than the root will not work. I dont think level 1 will be able to access any other scenes.
Then I will have to make a bunch of “if” codes.
if (scene=="scene1"){
gotoAndPlay("scene2","scene2Start");
}
if (scene=="scene2){
gotoAndPlay("scene3","scene3Start");
}
and so on......
:puzzle: :d: