I have an dir file with a lot of sprites, with scripts on
communicate with each other through #sendAllSprites command.
Many of these sprites have also an on exitFrame method in
If I want to leave current Movie and jump to another one, the
I discovered, that it is bound with execution of some methods
exitframe) on that sprites.
Player loads this second movie, obviously tries to execute
some methods from
first movie, does not find references to it and crashes
Because, when I jump first to another frame in the same
movie, without many
sprites with scripts and without sprite communication, and
jump to second
movie from that "poor content" sprite - everything works Ok.
How can I stop execution of all running events, methods etc
(so I do not
need to jump to some intermediate frame and then go to
Do I need to empty the scriptInstanceList for each Sprite, or
is there other
simple method fro stopping communication between sprites and
When I have problems of this type (sometimes even just
jumping to other frames in the same movie), I change the code so
that it is the
frame script which performs the 'go to frame' or 'go to
movie' function. This usually resolves any errors from 'stray'
behaviour handlers being called when the sprite has ended.
If a behaviour needs to initiate this, then you could perhaps
set a global variable in the behaviour, which is then checked by
the frame script, so that the frame script can tell when to jump to
the next movie.