# Best method for zoned sound?

**URL:** <https://forum.kirupa.com/t/best-method-for-zoned-sound/289268>\
**Category:** flash\
**Created:** [May 28, 2009, 9:33am UTC](https://forum.kirupa.com/t/best-method-for-zoned-sound/289268 "2009-05-28T09:33:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dst1](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@dst1](https://forum.kirupa.com/u/dst1)\
**Post date:** [May 28, 2009, 9:33am UTC](https://forum.kirupa.com/t/best-method-for-zoned-sound/289268/1 "2009-05-28T09:33:32Z")

</div>

I am trying to get sounds working in my game and would like to have different sounds play and loop depending on where my player.mc is within its parent mc (game.mc).

So if my game.mc is 1000 pixels wide and player.mc.x is \<= 500 it will play and loop sound1, and if player.mc.x is \> 500 it will play and loop sound2.

I have the playing and looping done with a SOUND\_COMPLETE listener but if one sound is playing and player.mc moves from one “zone” into the other I cant get the sound to stop and the new one to start. Currently it will only play the new sound once the previous sound ends.

I have probably gone about it all wrong and there will be a much simpler way to achieve this but I cant work it out. What is the best way to do this?
