# Stalling a timer?

**URL:** <https://forum.kirupa.com/t/stalling-a-timer/50998>\
**Category:** Uncategorized\
**Created:** [May 8, 2004, 4:33pm UTC](https://forum.kirupa.com/t/stalling-a-timer/50998 "2004-05-08T16:33:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![earleybird](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@earleybird](https://forum.kirupa.com/u/earleybird)\
**Post date:** [May 8, 2004, 4:33pm UTC](https://forum.kirupa.com/t/stalling-a-timer/50998/1 "2004-05-08T16:33:19Z")

</div>

Hi,

I’m tyring to do something a little complicated and I was hoping for some expertise!

I’m using a timer which triggers a gotoAndPlay after 5 secs. It works fine but I am now trying to work out if it is possible that if I press a button I would be able to stall the timer. i.e the goToAndPlay only happens after 5 sec otherwise the it is prevented and the the timer goes back to zero.

I know its a bit difficult to describe but I have attatched the .fla to help you see what I mean.

In terms of the code I’m using:

I have the function:

[color=blue]stop();  
function pause(){  
//play();  
gotoAndStop(21);  
clearInterval(timer);  
};[/color]  
[color=blue][color=black]This function is called when the playhead hits a certain frame:[/color][/color]  
[color=blue][color=#000000]i.e.[/color][/color]  
[color=blue][color=#000000][/color][/color]  
[color=blue]stop();[/color]  
[color=blue]timer = setInterval(pause, 3000);

[/color]If anyone has a clue what I’m talking about and can help I’d really apprectiate it!

Thanks Rache:q: 😏
