# Pause override on timed "endtime = getTimer"?

**URL:** <https://forum.kirupa.com/t/pause-override-on-timed-endtime-gettimer/202409>\
**Category:** flash\
**Created:** [September 30, 2006, 11:18pm UTC](https://forum.kirupa.com/t/pause-override-on-timed-endtime-gettimer/202409 "2006-09-30T23:18:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kb08807](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kb08807/32/449_2.png) [@kb08807](https://forum.kirupa.com/u/kb08807)\
**Post date:** [September 30, 2006, 11:18pm UTC](https://forum.kirupa.com/t/pause-override-on-timed-endtime-gettimer/202409/1 "2006-09-30T23:18:31Z")

</div>

I have a Flash movie that uses actionscript to pause for 5 seconds on each scene. I would like to have a Pause button that, when clicked, can “override” the 5 second timer, and stay paused until the user clicks the “forward” button to resume the movie. How can I make the pause button override the actionscript that is counting 5 seconds and then going to next scene?

The actionscript I’m using for the 5-second-then-go timer is contained within a movie clip that has in frame 1:  
endtime = getTimer() + Number(substring(\_name,5)) \* 1000;  
\_parent.stop();

then in that clip’s frame 3:  
if(getTimer() \< endtime) gotoAndPlay(2);

then in that clip’s frame 4:  
\_parent.play();

I put that clip on the first frame of each scene, and it counts 5 seconds before going to next scene. Works great. But when I put a pause button with the code:  
on (press) {  
\_parent.stop();  
}  
… that button doesn’t stop the movie. It seems that the timer movie clip overrides it and just keeps the movies moving every 5 seconds.

Any ideas on how I can get a pause button to work on this? Then I would want to “resume” the paused movie by hitting the “play” button to go to the next scene (in which the timer would then kick in again, hopefully).

I appreciate any ideas you have.
