0
votes

I have an AS3 movie clip that I want to return to first frame whenever it reaches the last frame.

The movieclip instance name is sym2.

I tried -

_root.sym2.gotoAndPlay(1); and sym2.gotoAndPlay(1);

but it doesn't work.

How can I instruct the movie clip to restart playing from first frame ?

regards

1
The first frame is 0, and not 1.user2655904

1 Answers

1
votes

Here is a good way of writing it without writing inside frames:

var backToStart:Function = new Function(){
    gotoAndPlay(1);
}
yourMovieClip.addFrameScript(yourMovieClip.totalFrames, backToStart);
//place this in the constructor