Skip to main content
December 6, 2010
Answered

loop timeline in movieclip then gotandplay frame

  • December 6, 2010
  • 1 reply
  • 384 views

Hi all,

I have an animation of a dog running across the stage and a movieclip called "legs" which is the legs moving. I want to loop the dogs legs for a certain amount of frames and then make it stop on a certain frame within that same nested "legs" movie clip.

Can anyone tell me how to do this and where the actionscript should go??

Many thanks!

Zoe

This topic has been closed for replies.
Correct answer Ned Murphy

In that frame you can place a conditional that tests how many times the animation has gone thru it and then have it stop at a particular number of times.  In the example code below, it stops on the 5th time thru.

var counter;

if(counter == null){
    counter = 1;
} else {
    counter += 1;
    if(counter == 5){
        stop();
    }
}

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
December 6, 2010

In that frame you can place a conditional that tests how many times the animation has gone thru it and then have it stop at a particular number of times.  In the example code below, it stops on the 5th time thru.

var counter;

if(counter == null){
    counter = 1;
} else {
    counter += 1;
    if(counter == 5){
        stop();
    }
}

December 6, 2010

Thanks Ned this works great:-)

Ned Murphy
Legend
December 6, 2010

You're welcome