Do I need to stop other frame animations myself?
It's really question about basics, but I want to ensure how it works. So I've a MovieClip symbol with 5 frames (let's call it the main MovieClip), ea开发者_如何转开发ch frame holds a different MovieClip symbol and each of those symbols has a small motion in them. If let's say I move to the 3rd frame in the main MovieClip:
object.gotoAndStop(3);
Then symbol's small motion animation, which frame 3 holds, automatically starts as I saw. So I'm thinking here do the other frames (1, 2, 4 and 5), which are not visible on stage though, are stopped and I don't need to worry about stopping each of them myself (like attaching code to each 1st frame to call .stop()
) ?
Because if I would now call right away object.gotoAndStop(1);
it would start that frame's animation right away. Just makes me wonder.
You don't need to manually stop the MovieClips, they are usually dereferenced(destroyed) once their keyframes expire. And created once their keyframe enters.
To reiterate, they don't EXIST before and after their keyframe. Not strictly true, of course (garbage collection), but for illustrative purposes it suffices. There is no need to "stop" their timelines since they don't exist, and once their keyframe creates them they will restart from frame 1 (without fancy actionscript, of course).
This only holds true for timeline movieclips, actionscript created movieclips will still have references and will persist through frame changes if my memory serves me correctly.
So actionscript MC's need to be taken care of manually (call removeChild() and dereference their reference if any).
精彩评论