View Full Version : gotoAndPlay();...... again......
Goosey
02-14-2003, 12:22 AM
Ok.. I don't know if it is the fact I using scenes or what, but gotoAndPlay is the command from HELL for me :(
Problem I have now is that when a combat sequence is over (by enemy defeat) it is supposed to advance to the next scene.. In one combat sequence I simply put a function with gotoAndPlay("scene","frame"); and then when the monster's script determined it was dead it executed that function.. worked fine...
The on another sequence I did the same thing, and it would not go to the next scene (instead it just restarted the frame).
The only difference between the sequences is that one is on the first frame of it's scene, and the other is on the 3rd of it's scene.
I have tested the first sequence to see if it can gotoAndPlay to the location the 2nd one is supposed to, and it can.. so that isn't the problem.
I have tried using gotoandplay in the function, gotoandplay in the monster's script, and it still just.... wont....... work.
I know you can't see my code.. It is hard to explaine exactly without showing you all the FLA, but that is 57megs :\
hi, goosey,
if you would do a search here for the word "scenes" you'll find it a lot next to the word "suck". Avoid working with them, use frame labels instead.
(57megs! o-oh - i hope you'll be able to r e n d e r a playable swf out of that)
Goosey
02-14-2003, 01:06 AM
Yes its too late to turn back now.. I am using frame labels in conjunction with scenes now.... But well.. still problems.....
One new problem: If i have a long tween and I want it to switch scenes on the last frame of the tween... putting _root.gotoAndPlay("Scene","framelabel"); doesnt work.. :\
Oh and i have the framelabel the same as the scene as I was told to do in an earlier post
maybe put up the file? if not someone else will have to help you out 'cause i haven't been working with scenes for more than a year and i don't dare to shoot in the dark :)
regards
tost
// edit: oh yeah i forgot the 57 megs
a good method for trouble shooting is to copy just the code you have a problem with to a new file, and try to fix it there without all the rest around. once you're sure it's okay, bring it back to your file and try it out. you could always upload the test file in that case :)
bluegel
02-18-2003, 04:19 PM
where you said you had :
_root.gotoAndPlay("Scene","framelabel");
sometimes you need to name your scenes. You might have done this already but if you haven't, try it. Then instead of
_root.gotoAndPlay("Scene","framelabel");
would be
_root.gotoAndPlay("Scene","framelabel"); and change scene to name of scene.
If this makes no sense, just ignore it.
ok :confused:
electronic ink
02-18-2003, 04:42 PM
Hi goosy goosy gander.
Try this:
gotoAndPlay ("/:nameoflabeltojumpto:)
That should be all you need to jump anywhere you place that label (make sure that each label has an individual name even on other scenes).
electronic ink
02-18-2003, 04:44 PM
Oops
I've still got sticky fingers.
This is the code:
gotoAndPlay ("/:nameoflabeltojumpto")
Goosey
02-18-2003, 06:59 PM
what is the /: about?
electronic ink
02-18-2003, 07:11 PM
/ is a nice and safe pathway to get you to the root timeline.
: this tells flash you are looking for labels.
One problem though, I don't know if it works in flash 4. I believe it does because flash 5 replaced 4's slash notation with dot notation.
Anyhow did it work?
electronic ink
nicmar
03-27-2003, 01:21 PM
Hmm this is weird.. I also use scenes.. and it seems to be stupid to just ignore them.. I think it's easier to manage my game using scenes..
I have this code on a movieclip.. when it's clicked, it should jump to another scene..
eval("landmask"+x).onrelease = function() {
_root.customplayer.sel_nation = loadnations[this.val];
gotoAndStop("registerplayer");
}
The name of the scene is "registerplayer".. i even tried "/:registerplayer" but no difference..
I wanna go to frame 1 of the scene.. how?
nicmar
03-27-2003, 01:26 PM
Ok.. so i did this..
on the other scene, i made a label on frame 1 called "scene2" and then used
gotoAndStop("/:scen2");
That actually worked..
Arghll.. why isn't anything about this in the documentation? Now I've wasted 2 hours on this.. I'm tired.. :(
Thanks anyways :)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.