Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.23 / 5.00 3,881 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.93 / 5.00 4,634 ViewsAlright, I'm trying to create a flash document where the user navigates from one page to another by clicking buttons. The problem is, I can't get the buttons to work. How do I make it so that when someone clicks on a button, they go to a different scene?
put something like this in the actionscript for your buttons:
on(press){
_root.gotoAndStop(frame);
}
or
on(press){
_root.gotoAndStop("scene_name", frame);
}
or
on(press){
_root.gotoAndStop("frame_lable");
}
you may not need the _root. in the actions if your buttons are on the main stage
The other thing you can do is label the frame in the other layer. Then Flash can find it no matter where it is.
Where do I put the action script?
At 1/27/05 10:55 PM, Lilj wrote: Labelings the frames does nothing execpt help you as a personal refrence.
I beg to differ. Labeling frames for navigation is preferred more so over frame and scene numbers. One reason is that Flash and Scenes get buggy. Instead of gotoAndPlay("Scene 2", 1); which can be buggy and may not even work correctly, you can label the frame "Here" and use gotoAndPlay("Here"); and it will goto that frame no matter where it is or where the action is (different scene, etc.).
There are other benefits beyond personal reference, but the avoidance of the Scene Headache is one of the stronger ones. Anyway, it is a good idea to start using frame labels as early as possible, especially for navigation.
I dont have a problem with scenes. Once you copy the code, go to button actions and paste it in there, and change one little number and no bugs.
I personally use scenes, the frame lable just wastes my time, i think. heh
the advantage of labelling is that even if you move the frame/keyframe, the label stays with that frame. So you won't have to change gotoAndPlay(10) to 11 for example. VERY handy if you add in a few frames for extra content or whatever :)
Benny_Creations