View Full Version : Button won't gotoAndPlay scene?
Illumination
04-11-2005, 03:59 PM
Sorry if this is a really really basic dumb question, but I have referred to the manuals and searched here .. experimented with as many different things as I can think of .. so sorry if this is stupid, but here's my question.
I have a button which REFUSES to link me to another scene in my Flash movie. Here is the code which doesn't work:
on(release) {
_root.gotoAndPlay("Scene2");
}
What is wrong? I'm really sick of fraking with this ....
I think you need to specify the frame to play from in the scene:
on(release) {
_root.gotoAndPlay("Scene2", 1);
}
Illumination
04-11-2005, 04:13 PM
Still does not work. The button gives its mouseDown state, but the movie stays in scene1.
Illumination
04-11-2005, 05:54 PM
Just tried this code based on other comments from this forum:
nav1.onRelease = function() {
_root.gotoAndPlay ("scene3");
}
nav2.onRelease = function() {
_root.gotoAndPlay ("scene2");
}
This code is applied to a frame in the movie clip the buttons are in, and the code assigned to the buttons themselves has been removed. This doesn't generate any error messages, but it still doesn't seem to do anything at all.
"nav1" and "nav2" are the names I've assigned to the buttons.
Definitely going to steer away from working with scenes after this. Problem is there's too much work put into it to start over now.
HeldByStarlight
04-11-2005, 06:18 PM
okay, one thing is that Flash doesn't recognize scene names. the best way to do it is to name the first frame in the scene something, like start_2 (for start scene 2) so that way, your code would look like:
[as]
nav2.onPress = function() {
gotoAndPlay("start_2");
};
The other thing to check is to make sure that your buttons have instance names... its a really easy thing to forget.
Hope that helps! :D
Illumination
04-11-2005, 08:54 PM
okay, one thing is that Flash doesn't recognize scene names. the best way to do it is to name the first frame in the scene something, like start_2 (for start scene 2) so that way, your code would look like:
[as]
nav2.onPress = function() {
gotoAndPlay("start_2");
};
The other thing to check is to make sure that your buttons have instance names... its a really easy thing to forget.
Hope that helps! :D
THANK YOU! That did it! I love this place.
viper09
09-25-2007, 11:41 AM
THANK YOU! That did it! I love this place.
sorry ladies and gents but I have the same problem and I have followed the comments on this thread but still have the same problem..
I am using code on the button and it is as follows:
on (release) {
_root.gotoAndPlay(106);
}
however, when i click on the button nothing happens... and i need it to go to frame no 106 and continue playing... please please please help.
atomic
09-25-2007, 03:38 PM
Attach your .fla.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.