# Help in gotoAndPlay sound

**URL:** <https://forum.kirupa.com/t/help-in-gotoandplay-sound/321362>\
**Category:** flash\
**Created:** [April 18, 2011, 8:59am UTC](https://forum.kirupa.com/t/help-in-gotoandplay-sound/321362 "2011-04-18T08:59:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![essa2002135](https://avatars.discourse-cdn.com/v4/letter/e/a5b964/32.png) [@essa2002135](https://forum.kirupa.com/u/essa2002135)\
**Post date:** [April 18, 2011, 8:59am UTC](https://forum.kirupa.com/t/help-in-gotoandplay-sound/321362/1 "2011-04-18T08:59:31Z")

</div>

Hello my friend

now i have  
3 button  
one to play (bt1) so.gotoAndPlay(“m1”); sound  
and other (bt2) so.gotoAndPlay(“m2”); sound  
and button to play all m2 then m1 sound

theis button like that  
 ![](http://egyptinkuwait.com/flash/2.jpg)

and the sound in diffrent layer like that

![](http://egyptinkuwait.com/flash/1.jpg)

and this the code

bt1.addEventListener(MouseEvent.CLICK ,pt1);  
bt2.addEventListener(MouseEvent.CLICK ,pt2);  
playy.addEventListener(MouseEvent.CLICK ,all);

function pt1(event:MouseEvent):void  
{  
so.gotoAndPlay(“m1”);  
}

function pt2(event:MouseEvent):void  
{

so.gotoAndPlay(“m2”);  
}

function all(event:MouseEvent):void  
{

so.gotoAndPlay(“m2”);  
so.gotoAndPlay(“m1”);

}

problem is when i click all button to run sound m2,m1 the sound play togather  
i want to play m2 then stop then play m1  
note the layer label m2 come after m1  
so i want to play and stop m2 first then play and stop m1 second

please help me  
thank you
