0
votes

I'm having a weird problem with Flash working in AS2 where a gotoAndPlay script is not working so well for me...

I have a scene with a movie clip. Inside my movie clip I have a stop on the first frame, and at frame 2 and 100 there are two different animations. I'll begin with saying that I managed to go around the goto problem with a play action, so through the main scene at a specific keyframe I gave my movie clip this action:

onClipEvent (enterFrame) {
    play();
}

So the movie clip started to play the animation on its 2nd frame and everything was cool.

But what if I wanted to play the one starting at 100? so I did this:

onClipEvent (enterFrame) {
    gotoAndPlay(100);
}

And obviously, for some reason, the movie clip did not go to 100 and play.

I do not want to use any button commands to make it work! I want the movie clip to start playing when told to from my root scene, at a certain frame within it. Any suggestions?

Thanks, Guy

1

1 Answers

1
votes

onClipEvent(enterFrame) will create a listener that will be called in every frame after you set it up like that (even after you called stop(), your "play()" code will be called 24 or something times per second!). You don't want that. If you only want to execute "gotoAndPlay(100)" once, just write it there. No reason for lines 1 and 3.