Skip navigation
Rockz Gonzales
Currently Being Moderated

How to Restart MovieClip with stop animation in a Main Timeline Looping Animation

Jun 19, 2012 8:24 PM

Tags: #as3 #animation #actionscript3 #looping #adobe_flash_cs5 #movieclip_animation

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!

 
Replies
  • Currently Being Moderated
    Jun 20, 2012 4:22 AM   in reply to Rockz Gonzales

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 20, 2012 2:32 PM   in reply to Rockz Gonzales

    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)

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 22, 2012 12:06 AM   in reply to iFlashAppsToo

    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)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points