factory
02-16-2009, 03:52 PM
Hi guys,
I've run into a problem with this game I'm making. Basically, it has a pause function, which I've worked out all fine, but one problem persists - I need to make it so that when the game is paused, all movie clips that are playing are stopped (like, for example, an enemy running animation) and when the game is continued, they continue on from the frame they stopped at.
Now, from looking around online, I found this:
http://dreamweaverforum.info/actionscript/94008-how-can-i-stop-all-movie-clips-main-timeline.html
And I integrated the stop code shown on that webpage into my game, so that when the game is paused, all movie clips stop. This worked.
However, the problem lies in the next bit. See next I duplicated the script and changed it from stop to play - so that when the game goes from pause to playing the game, all the movie clips that were stopped would continue.
However, instead of doing that, it did what it was supposed to - and played every movie clip on stage, even the ones which weren't playing before the pause. This obviously messed up my game somewhat, so I had to take the code out. But now I'm stuck with a choice - I can either have all of the movie clips continue playing after a pause continues, or have none of them. Neither situation works.
So I was wondering if anyone could help me out here, it would be greatly appreciated. Is there some sort of code that I can use that will only stop the timelines of movie clips that are playing - and then another code that will continue those same timelines?
I'm stumped on this. :confused:
I've run into a problem with this game I'm making. Basically, it has a pause function, which I've worked out all fine, but one problem persists - I need to make it so that when the game is paused, all movie clips that are playing are stopped (like, for example, an enemy running animation) and when the game is continued, they continue on from the frame they stopped at.
Now, from looking around online, I found this:
http://dreamweaverforum.info/actionscript/94008-how-can-i-stop-all-movie-clips-main-timeline.html
And I integrated the stop code shown on that webpage into my game, so that when the game is paused, all movie clips stop. This worked.
However, the problem lies in the next bit. See next I duplicated the script and changed it from stop to play - so that when the game goes from pause to playing the game, all the movie clips that were stopped would continue.
However, instead of doing that, it did what it was supposed to - and played every movie clip on stage, even the ones which weren't playing before the pause. This obviously messed up my game somewhat, so I had to take the code out. But now I'm stuck with a choice - I can either have all of the movie clips continue playing after a pause continues, or have none of them. Neither situation works.
So I was wondering if anyone could help me out here, it would be greatly appreciated. Is there some sort of code that I can use that will only stop the timelines of movie clips that are playing - and then another code that will continue those same timelines?
I'm stumped on this. :confused: