# Sounds overlapping

**URL:** <https://forum.kirupa.com/t/sounds-overlapping/4972>\
**Category:** Uncategorized\
**Created:** [August 27, 2002, 1:44pm UTC](https://forum.kirupa.com/t/sounds-overlapping/4972 "2002-08-27T13:44:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iammontoya](https://avatars.discourse-cdn.com/v4/letter/i/bbce88/32.png) [@Iammontoya](https://forum.kirupa.com/u/Iammontoya)\
**Post date:** [August 27, 2002, 1:44pm UTC](https://forum.kirupa.com/t/sounds-overlapping/4972/1 "2002-08-27T13:44:56Z")

</div>

if I have two button driven sound events. How do I keep the sound from overlapping? I want the first one to stop and the next one to begin.

I did try the sound.stop() with the newsound constructor, but it’s acting weird.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2002, 2:34pm UTC](https://forum.kirupa.com/t/sounds-overlapping/4972/2 "2002-08-27T14:34:34Z")

</div>

Two possibilities -

One is to add the linkage ID name to the stop command -

mySound.stop(“IDNameHere”)

Or, and probably best, assign each sound to its own unique mc - like an empty clip, as in:

MySoundObject=new Sound(MCNameHere); //no quotes

MySoundObject.attachSound(“IDNameHere”);

I’ve got my sound object tutorial up and running at:

[http://www.kennybellew.com](http://www.kennybellew.com)

There are more examples there.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2002, 2:36pm UTC](https://forum.kirupa.com/t/sounds-overlapping/4972/3 "2002-08-27T14:36:41Z")

</div>

Hi,

Have u attached the sounds to movieclips?

I had that problem and solved it by doing that.

Use something like this:

aSound = new Sound(aSoundContainer);  
bSound = new Sound(bSoundContainer);

where aSoundContainer and bSoundContainer are movieclips to which u attach the sounds like:

aSound.attachSound(“soundfry”);  
bSound.attachSound(“soundboil”);

soundfry and soundboil are the linkage ID names of the sounds.

Cya

Sho

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2002, 2:37pm UTC](https://forum.kirupa.com/t/sounds-overlapping/4972/4 "2002-08-27T14:37:41Z")

</div>

Sorry,

where aSoundContainer and bSoundContainer are INSTANCE NAMES of movieclips to which u attach the sounds like:

Sho

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2002, 2:41pm UTC](https://forum.kirupa.com/t/sounds-overlapping/4972/5 "2002-08-27T14:41:17Z")

</div>

If in doubt, put a stopAllSounds(); command in there somewhere, to stop everything before playing another. Providing this option still exists in MX of course…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2002, 2:45pm UTC](https://forum.kirupa.com/t/sounds-overlapping/4972/6 "2002-08-27T14:45:09Z")

</div>

thanks, fellers… ehheeh

I had tried the methods you described, except for the attachsound. I’ll give it a shot.

Thanks, Compadres!!

It is amazing that I had not run into that problem before… Isn’t it?
