Skip to main content
Participant
May 27, 2009
Question

How to play the same animation in two different ways?

  • May 27, 2009
  • 2 replies
  • 596 views

I'm trying to make an animation possible to play in two different ways. The first one is to play animation from beginning to end without stopping The second one is an interactive way - something like slideshow made in powerpoint. My idea was to use gotoAndPlay() function with stop() function. It doesn't work the way as I expect. For instance - I've one animation made of 500 frames. It makes up some 10 slides. If I put after every 50 frames stop() function then it's impossible to play this animation from beginning to end without stopping because of stop(). How to handle this? It would be nice if there was a function to indicate to play between some frames. For example, start playing from 1 until 50, then stop. Then start playing from 52 until 100 and stop .... then from 450 to 500. Besides that from 1 to 500.

This topic has been closed for replies.

2 replies

May 27, 2009

Also, there's no need to use gotoAndPlay(), plain old play() will work too. Then you won't have to skip any frames.

Ned Murphy
Legend
May 27, 2009

I don't know what your criteria/controls would be for stopping versus not stopping, but the way you could control the stop()'s is to have a conditional that tests a variable to decide whether or not to stop.  You'd have to decide what is used to set that variable to true or false.

var shouldStop:Boolean = false;  // starting value

then in each potential stop frame...

if(shouldStop){

     stop();

}