Copy link to clipboard
Copied
Hi AS3 Guys,
I need help with my flash work regarding the looping animation.
--------------------------------------------------------------------------------------------------------------------
Problem Case: I have Main Timeline which is a looping animation, within the Main Timeline there is movieclip named "MC" ( inside the movieclip timeline, I put stop(); so that the movieclip will not play automatically within the main timeline and wait for the animation to be finished ), but the problem is when the 2nd iteration of animation, the movie clip stops and doesnt restart its animation.
Note:
The total length of animation is 11secs @ 18FPS with a total of 199Frames
The movieclip is a only part of the main animation that had own animation itself.
I need AS3 code.
Question: How do I restart the movieclip animation in every iteration/loop of the main timeline animation. What am I going to do?
--------------------------------------------------------------------------------------------------------------------
I tried some sample on the internet but no one works for me. Any answer would be great help. Thanks!
Copy link to clipboard
Copied
I don't know that I can understand your problem, but if you need the animation to continuously loop, then do not put a stop(); in its timeline. If you need it stopped at the beginning of something, use a targeted stop() command in the main timeline, as in:
yourAnimation.stop();
That way, there is not stop() command inside the animation that will make it stop when it is supposed to loop.
Copy link to clipboard
Copied
sounds like your main timeline loops
and the main timeline has a movieclip that is also supposed to loop, just not the first time that the main timeline plays to the end
is this correct? if so, one possible solution could be:
1. remove the stop() from yourMovieClipAnimation
2. add this to the main timeline in frame 1:
var firstTime:Boolean = true
yourMovieClipAnimation.gotoAndStop(1)
3. then in the last frame:
if(firstTime){
firstTime = false
yourMovieClipAnimation.play()
}
gotoAndPlay(2)
i say (2) because you dont want to reset the firstTime variable back to true if you goToAndPlay(1)
Copy link to clipboard
Copied
or is it more like this:
your main timeline loops
and the main timeline has a movieclip that is also supposed to loop, but not until the main timeline loops
is this correct? if so, one possible solution could be adding this to the main timeline in frame 1:
MC.gotoAndPlay(1)
Copy link to clipboard
Copied
Well, I have the same problem. Now it works fine with your code! Thanks