# Play/Pause toggle used for multiple movieclips

**URL:** <https://forum.kirupa.com/t/play-pause-toggle-used-for-multiple-movieclips/321329>\
**Category:** flash\
**Created:** [April 16, 2011, 9:40pm UTC](https://forum.kirupa.com/t/play-pause-toggle-used-for-multiple-movieclips/321329 "2011-04-16T21:40:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sslat](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@sslat](https://forum.kirupa.com/u/sslat)\
**Post date:** [April 16, 2011, 9:40pm UTC](https://forum.kirupa.com/t/play-pause-toggle-used-for-multiple-movieclips/321329/1 "2011-04-16T21:40:18Z")

</div>

I am setting up a module that has about 10 movieclips, all on the stage on one layer. I have a play/pause toggle button and next button that I want to use as the media player for all the movieclips and just make the movieclips visible or not.  
Does anyone have an idea of how I phrase a conditional statement to have subsequent movieclips play when the “next” button and then “play” are selected?  
Here’s the code for the toggle with 2 movieclips in there. I appreciate any ideas.

var playing:Boolean=false;  
toggle\_mc.sto\_btn.visible=false;  
oveSe\_mc.visible=true;  
geZo\_mc.visible=false;

toggle\_mc.addEventListener(MouseEvent.MOUSE\_UP,toPlay);  
function toPlay(event:MouseEvent):void{  
if (toggle\_mc.pla\_btn.visible == true){  
oveSe\_mc.stop();  
toggle\_mc.pla\_btn.visible=false;  
toggle\_mc.sto\_btn.visible=true;  
playing=true;  
}else {  
oveSe\_mc.play();  
toggle\_mc.pla\_btn.visible=true;  
toggle\_mc.sto\_btn.visible=false;  
playing=false;  
}  
}
