all groups > flash actionscript > january 2005 >
You're in the

flash actionscript

group:

gotoAndPlay inconsistency in game



gotoAndPlay inconsistency in game Ry-Tracer
1/14/2005 11:22:51 PM
flash actionscript: Hello all, has anyone encountered the following problem?
when gotoAndPlay is invoked in a very busy part of a shockwave file, it skips
that line of code. Well actually via the step-through, it plays that line but
nothing happens.
I know the problem is not within the call to the function because it works
when the game is not too busy. In my game I have a character that looks
different when it jumps. If you are running right and hit space it will do the
jump. If, however, the completely unrelated, and uncoded key of K is pressed,
the character does not change to jumping mode, but performs all other commands
within the code block, thus signifying the space keystroke was valid, the only
thing skipped was gotoAndPlay. At another point in the game, several (like 40)
mc's are loaded onscreen at the same time, each with a valid gotoAndPlay
function (again verified in some other way) in their onClipEvent(load) handlers
that seldom run. This game performs very inconsistently because the
gotoAndPlay functions cease to function at busy times. Any ideas? Oh yeah, I
also have no errors or warnings.

My one idea is that maybe the gotoAndPlay function could return, or already
does return a value if it didn't play, like a boolean false or a NULL. Lots of
windows functions do that, and then the programmer can handle the value and try
to run the function again, like next frame. I however have not experimented
with this at all because of the sheer quantity of gotoAndPlays in my code. I
want to know it works before I change everything.
Re: gotoAndPlay inconsistency in game Jeckyl
1/17/2005 10:34:16 AM
it sounds very much like you've simply not coded your script correctly (ie
the bug is in what you've written (most likely) and not in the play (least
likely)).

NOTE: There ARE problems with gotoAndPlay is you use scene names , so never
do that.
--
All the best,
Jeckyl

AddThis Social Bookmark Button