# Flash 9, CS3. Sound object affecting global sounds

**URL:** <https://forum.kirupa.com/t/flash-9-cs3-sound-object-affecting-global-sounds/317533>\
**Category:** flash\
**Created:** [December 23, 2010, 4:52pm UTC](https://forum.kirupa.com/t/flash-9-cs3-sound-object-affecting-global-sounds/317533 "2010-12-23T16:52:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jshock](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jshock](https://forum.kirupa.com/u/jshock)\
**Post date:** [December 23, 2010, 4:52pm UTC](https://forum.kirupa.com/t/flash-9-cs3-sound-object-affecting-global-sounds/317533/1 "2010-12-23T16:52:29Z")

</div>

I have a sound object that I want to control independently of other sounds in my movie. I created a volume button, but it is affecting all sound in the movie. Am I doing something wrong? Here is the volume button script. BTW the other sounds in the movie are not sound objects, they’re in the timeline.

\_root.musicLoop\_snd = new Sound(musicLoop\_snd);// Create sound object  
\_root.musicLoop\_snd.attachSound(“FPOmusicLoop.aif”);// Attach library sound to object  
\_root.musicLoop\_snd.start();//Play sound  
\_root.musicLoop\_snd.setVolume(30);

// PAUSE/PLAY  
var loopPlaying = “loopOn”;  
sound\_mc.onRelease = function() {  
if(\_root.loopPlaying==“loopOn”){ // These happen on PAUSE  
\_root.sound\_mc.gotoAndStop(“paused”);  
\_root.loopPlaying=“loopOff”;  
\_root.musicLoop\_snd.setVolume(0);  
} else if(\_root.loopPlaying==“loopOff”){ // These happen on PLAY  
\_root.sound\_mc.gotoAndStop(“playing”);  
\_root.loopPlaying=“loopOn”;  
\_root.musicLoop\_snd.setVolume(30);  
}  
};  
sound\_mc.onRollOver = function() {  
if(\_root.loopPlaying==“loopOn”){  
\_root.sound\_mc.gotoAndStop(“playingOver”);  
} else if(\_root.loopPlaying==“loopOff”){  
\_root.sound\_mc.gotoAndStop(“pausedOver”);  
}  
};  
sound\_mc.onRollOut= function() {  
if(\_root.loopPlaying==“loopOn”){  
\_root.sound\_mc.gotoAndStop(“playing”);  
} else if(\_root.loopPlaying==“loopOff”){  
\_root.sound\_mc.gotoAndStop(“paused”);  
}  
};
