# It appears as though any play(); overrides my stop();

**URL:** <https://forum.kirupa.com/t/it-appears-as-though-any-play-overrides-my-stop/291055>\
**Category:** flash\
**Created:** [June 24, 2009, 2:48am UTC](https://forum.kirupa.com/t/it-appears-as-though-any-play-overrides-my-stop/291055 "2009-06-24T02:48:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerogun](https://avatars.discourse-cdn.com/v4/letter/z/b3f665/32.png) [@zerogun](https://forum.kirupa.com/u/zerogun)\
**Post date:** [June 24, 2009, 2:48am UTC](https://forum.kirupa.com/t/it-appears-as-though-any-play-overrides-my-stop/291055/1 "2009-06-24T02:48:06Z")

</div>

Sorry for the lack of a better title. This is a clear as I can postulate the question, so forgive me lack of coding background.

The situation is this: inside a MC there are frames with a pause script as such…

stop();  
var interval:Number = setInterval(  
function():Void {  
play();  
clearInterval(interval);  
},  
5000  
);

At the same frame on a different layer resides a button with the function to disregard the pause and continue playing the timeline like so…

on (release){  
gotoAndPlay(“l5”);  
}

After pushing the button all appears to work fine until I reach a frame where I’ve placed…

stop();  
clearInterval(interval);

It appears though whenever I override the pause script with the action of the button, the MC continues playing past the frame with the stop(); action and actually seems as though the pause script has been placed inside the frame where I want it to stop.

If I leave the MC to play on its own i.e. not pressing the button, the MC plays just perfectly and stops right where I want it to.

I’m not a programming kind of guy, so I would definitely appreciate all the help and suggestion you guys can throw at me. I’d like to understand why is it that when I call the action from the button, it essentially overrides my stop();.

I hope I’ve made a good effort in presenting you guys with a clear problem. Thanks in advance.
