A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to Restart MovieClip with stop in a Main Timeline Looping Animation?

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Location
    Manila, Philippines
    Posts
    2

    Question How to Restart MovieClip with stop in a Main Timeline Looping 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!

  2. #2
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    Use the gotoAndPlay() method. This will play the movie clip on the next timeline iteration.

    For example,

    Code:
    MC.gotoAndPlay(2);
    If you are currently using the play() method to start the movie clip's animation. The playhead will still be at the end of the movie clip's timeline when the animation finishes. Therefore the next timeline iteration the movie clip will not play. If you use the MC.gotoAndPlay(2) method it will restart the playhead from the second frame.
    Last edited by ilike2; 06-20-2012 at 04:53 AM. Reason: typo

  3. #3
    Junior Member
    Join Date
    Jan 2007
    Location
    Manila, Philippines
    Posts
    2

    Thumbs up

    hi there, yeah it works. Thanks for the great help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center