I'm a bit new to Flash. As I was developing my movie, I introduced 3 layers of sequential animation that I decided I wanted to loop X times. So I copied the frames, created a new Movie Clip symbol, pasted the frames into it, then deleted the original on the stage and dragged this new clip as an instance (my_animation
) in its place. All good so far.
However, when I play the entire movie, my_animation
looped indefinitely, so I added a stop() action into that movie clip. That worked - plays once. I then added the following as an action on the very last keyframe of the main scene to try and get my_animation to loop X times:
var i = 1;
for (i = 1;i < 5;i++)
{
my_animation.play();
}
stop();
However, my_animation
still only plays once. It does not appear to loop as I expect. I also tried replacing my_anmiation.play()
with gotoAndPlay(117)
where 117
is the frame containing the movie clip, but still the same.
Any help appreciated.
Thanks
UPDATE: I added a trace(i);
statement within the loop. In the Output tab, I see:
1
2
3
4
…etc. SO - my_animation
is not firing within the loop.