# Trouble with Pause / Play Buttons

**URL:** https://forum.kirupa.com/t/trouble-with-pause-play-buttons/50490
**Category:** flash
**Created:** [May 3, 2004, 5:59pm UTC](https://forum.kirupa.com/t/trouble-with-pause-play-buttons/50490 "2004-05-03T17:59:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Monte323](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@Monte323](https://forum.kirupa.com/u/Monte323)
#### Post date: [May 3, 2004, 5:59pm UTC](https://forum.kirupa.com/t/trouble-with-pause-play-buttons/50490/1 "2004-05-03T17:59:36Z")

</div>

Hello all,

Having some trouble with a slideshow flash file. The snippet of AS is attached below. The play functionality is working fine, but when the slideshow is running, the pause button won’t work. Any idea what I’m doing wrong?

NextFrame = function(){  
if (whichPic\<NumCount) {  
bLoad = true;  
whichpic++;  
} else {  
if (whichPic==NumCount){  
bLoad = true;  
whichPic = 1;  
}  
}  
}

PlayBTN.onRelease = function() {  
setInterval(NextFrame, 2000);  
}

PauseBTN.onRelease = function() {  
clearInterval(NextFrame);  
stop();  
}
