# MC play/stop

**URL:** <https://forum.kirupa.com/t/mc-play-stop/311560>\
**Category:** flash\
**Created:** [July 10, 2010, 1:59am UTC](https://forum.kirupa.com/t/mc-play-stop/311560 "2010-07-10T01:59:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rserge](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@rserge](https://forum.kirupa.com/u/rserge)\
**Post date:** [July 10, 2010, 1:59am UTC](https://forum.kirupa.com/t/mc-play-stop/311560/1 "2010-07-10T01:59:39Z")

</div>

Hello

I have some code attached to a button, but its not working…consistently.

```auto

on (press) {
	stopAllMCs = function(){
    //map_mc.site39_mc.stop();
    //map_mc.site40_mc.stop();
    // The above works...
    // but for the clips to return to their original state...
    // and not only stop at whatever frame they're at...
    // you might better use...
    _root.map_mc.site39_mc.gotoAndStop(1);
    _root.map_mc.site40_mc.gotoAndStop(1);
};
	stopAllMCs();
    _root.map_mc.site39_mc.gotoAndPlay(2);
	_root.srchMC._visible=false;
}

```

Explanation: When I click on button it plays site39\_mc. If I click the same button again it stops playing site39\_mc. I don’t want it to stop. If I try to click on the button a third time it does not restart the site39\_mc. (If I click on a second button to play site40\_mc, then come back to the first button it works.)  
I am thinking of an “if” statement.

if \_root.map\_mc.site39\_mc ??? (is playing, or visible?)  
{…}  
I want to tell it to basically do nothing if its already playing, rather than to stop it. I have the stopAllMCs element in there, maybe that is messing it up?

Thanks.
