# How to stop a function?

**URL:** https://forum.kirupa.com/t/how-to-stop-a-function/190416
**Category:** Uncategorized
**Created:** [June 11, 2006, 4:06pm UTC](https://forum.kirupa.com/t/how-to-stop-a-function/190416 "2006-06-11T16:06:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![enginenr9](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@enginenr9](https://forum.kirupa.com/u/enginenr9)
#### Post date: [June 11, 2006, 4:06pm UTC](https://forum.kirupa.com/t/how-to-stop-a-function/190416/1 "2006-06-11T16:06:35Z")

</div>

Hi.

I have this function:

function proceed()  
{  
if (this.\_currentframe == 4)  
{  
this.gotoAndPlay(1);  
}  
else  
{  
clearInterval(delayTime);  
nextFrame();  
}  
}

How can I stop it trough a button?
