# Simple sound questions

**URL:** <https://forum.kirupa.com/t/simple-sound-questions/42590>\
**Category:** Uncategorized\
**Created:** [February 10, 2004, 8:25pm UTC](https://forum.kirupa.com/t/simple-sound-questions/42590 "2004-02-10T20:25:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandman9](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@Sandman9](https://forum.kirupa.com/u/Sandman9)\
**Post date:** [February 10, 2004, 8:25pm UTC](https://forum.kirupa.com/t/simple-sound-questions/42590/1 "2004-02-10T20:25:31Z")

</div>

I have on my main timeline

```auto

muz = new Sound();
muz.attachSound("music");
muz.start(0,999);
winz = new Sound();
winz.attachSound("wind");
winz.start(0,999);

```

So it’s starting two different sound loops

then on my stop music button I have

```auto

on (release) {
	_parent.muz.stop();
	gotoAndPlay("mon");
}

```

This all works fine except when i click on the button it turns off BOTH sound instead of the one i’m targeting

anyone know why?

Sandman9

---

<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:** [February 10, 2004, 8:34pm UTC](https://forum.kirupa.com/t/simple-sound-questions/42590/2 "2004-02-10T20:34:11Z")

</div>

> The Sound object lets you control sound in a movie. You can add sounds to a movie clip from the Library while the movie is playing and control those sounds. **If you do not specify a target when you create a new Sound object, you can use the methods to control sound for the whole movie**. You must use the constructor new Sound to create an instance of the Sound object before calling the methods of the Sound object.

[http://www.macromedia.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary654.html](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary654.html)

---

<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:** [February 10, 2004, 8:39pm UTC](https://forum.kirupa.com/t/simple-sound-questions/42590/3 "2004-02-10T20:39:39Z")

</div>

ohhhh they are both targeting “new sound();” … that’s a rather poor mistake on my part …

So to fix the problem I don’t suppose I could replace new sound(); with say a variable b/c it’s declaring a new sound … ummm … so how can i differentiate the two then?

Sandman9

---

<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:** [February 10, 2004, 8:42pm UTC](https://forum.kirupa.com/t/simple-sound-questions/42590/4 "2004-02-10T20:42:58Z")

</div>

To fix the problem, you must give the sounds targets. Controlling any Sound instance that has been created without a target will control every sound in the entire movie, as stated in the quote above.

It comes down to changing

```auto

muz = new Sound(this);

```

Where this is the target of the Sound instance. I don’t know if you can use the same target twice - try it out. If not, create an empty movieclip and use that as a target.

---

<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:** [February 10, 2004, 8:43pm UTC](https://forum.kirupa.com/t/simple-sound-questions/42590/5 "2004-02-10T20:43:26Z")

</div>

To fix the problem, you must give the sounds targets. Controlling any Sound instance that has been created without a target will control every sound in the entire movie, as stated in the quote above.

It comes down to changing

```auto

muz = new Sound();

```

to

```auto

muz = new Sound(this);

```

Where this is the target of the Sound instance. I don’t know if you can use the same target twice - try it out. If not, create an empty movieclip and use that as a target.

---

<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:** [February 10, 2004, 8:50pm UTC](https://forum.kirupa.com/t/simple-sound-questions/42590/6 "2004-02-10T20:50:17Z")

</div>

you have come to the rescue again 😃

I gave the MC’s that the stop buttons were in instance names … then I just changed it to like you said

```auto

muz = new Sound(instance_name);

```

Thanks again  
Sandman9

---

<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:** [February 10, 2004, 8:51pm UTC](https://forum.kirupa.com/t/simple-sound-questions/42590/7 "2004-02-10T20:51:42Z")

</div>

No problem 😉
