# Volume conflict in actionscript

**URL:** <https://forum.kirupa.com/t/volume-conflict-in-actionscript/18171>\
**Category:** flash\
**Created:** [April 14, 2003, 3:55am UTC](https://forum.kirupa.com/t/volume-conflict-in-actionscript/18171 "2003-04-14T03:55:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Troll\_axethrowe](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@Troll\_axethrowe](https://forum.kirupa.com/u/Troll_axethrowe)\
**Post date:** [April 14, 2003, 3:55am UTC](https://forum.kirupa.com/t/volume-conflict-in-actionscript/18171/1 "2003-04-14T03:55:10Z")

</div>

im having a problem with buttons using actionscript to set the volume for a sound. Here’s what i have  
[AS]   
on (rollOver){  
limit= new Sound(this)  
limit.attachSound(“limit”)  
limit.start()  
limit.setVolume(200)  
}  
[/AS]  
The problem is that the setVolume command sets ALL of the volumes for sounds in that scene to 200%, not just the one sound i want to put at 200% volume. Does anyone know how i can solve this problem?

---

<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:** [April 14, 2003, 9:06am UTC](https://forum.kirupa.com/t/volume-conflict-in-actionscript/18171/2 "2003-04-14T09:06:31Z")

</div>

try this :

```auto
on (rollOver){
limit.createEmptyMovieClip("clip", 0);
limit.clip = new Sound(this.limit);
limit.clip.attachSound("limit")
limit.clip.start()
limit.clip.setVolume(200)
}

```

if it works…  
search the explanation on this forum!!

---

<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:** [April 14, 2003, 8:42pm UTC](https://forum.kirupa.com/t/volume-conflict-in-actionscript/18171/3 "2003-04-14T20:42:14Z")

</div>

nope this doesnt work, anyone else have any ideas?

---

<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:** [April 14, 2003, 8:58pm UTC](https://forum.kirupa.com/t/volume-conflict-in-actionscript/18171/4 "2003-04-14T20:58:21Z")

</div>

ups… sorry what a mess!!  
it should be : this.createEmptyMovieClip();

try this, load all your sound at \_root first:

```auto
this.createEmptyMovieClip("sound01", 1);
sound01.createEmptyMovieClip("clip", 0);
sound01.clip = new Sound(this.sound01);
sound01.clip.attachSound("limit");

```

the button

```auto
on(rollOver){
_root.sound01.clip.start();
_root.sound01.clip.setVolume(200);
}

```

tell me if it works…  
sorry again…

---

<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:** [April 14, 2003, 9:19pm UTC](https://forum.kirupa.com/t/volume-conflict-in-actionscript/18171/5 "2003-04-14T21:19:28Z")

</div>

taken from [http://www.kennybellew.com/](http://www.kennybellew.com/)  
**suggestions for planning your sound objects:**  
When possible, define all of your sound objects on the \_root level. For example, create a layer called “Sound Objects” on the \_root level. Define all sound objects in the first frame of this layer. This way, the path to your sound object will never be a mystery. If you’ve ever experienced the madness of trying to determine why a sound will not start or why more sounds are stopping than intended, this will help isolate the problem quickly.

and here’s why use a separate instance of a blank movieclip as the holder [http://www.actionscript-toolbox.com/soundobject.php](http://www.actionscript-toolbox.com/soundobject.php)

---

<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:** [April 14, 2003, 10:18pm UTC](https://forum.kirupa.com/t/volume-conflict-in-actionscript/18171/6 "2003-04-14T22:18:43Z")

</div>

thanks tons, just 1 more question though. I previously had an onSoundColplete function, but now its a movie clip. What do i change it to?
