Flash MX
In a movie symbol, I put
_root.gotoAndPlay(nextSceneName, 1);
But the it won’t go to the next scene. What’s wrong with this code?
Flash MX
In a movie symbol, I put
_root.gotoAndPlay(nextSceneName, 1);
But the it won’t go to the next scene. What’s wrong with this code?
had that same problem! I searched for hours on end, and just ended up redoing the whole thing
I think i heard somewhere that its a problem with the coding for flash, but im not sure though.
You’re right. I’ve tested extensively on what the problem is: it’s that exact line of code. If I replace that line with anything else, it will run that “something else.” So the problem shouldn’t be in the surrounding code or whatnot. Oh great, there goes my game for the Flash game contest.
I attached a very simple .fla that exemplifies the problem I have. In scene 1, I have a movie clip on frame 1 and a stop(); action on frame 1. At the end of this movie clip, I wrote:
_root.gotoAndPlay("Scene2",1);
You guessed it: it doesn’t work!
This is probably a extremely wrong way to get around this, but you could get around this by setting a variable in the movieclip like:
goToNext = "yes";
And on the main timeline keep checking for it:
this.onEnterFrame = function () {
if (goToNext == "yes") {
gotoAndPlay(nextSceneName, 1);
delete this.onEnterFrame;
}
}
I solved the problem. Some people on Flashkit told me that you can’t do this style of targeting within a movie clip. You just have to write _root.gotoAndPlay(“framelabel”); without the scene name. Cubed, that should help you too.
Seems like a much better approach than what I suggested hehe.
ghjr
:: Copyright KIRUPA 2024 //--