# Volume control slider

**URL:** <https://forum.kirupa.com/t/volume-control-slider/304578>\
**Category:** Uncategorized\
**Created:** [February 10, 2010, 10:11am UTC](https://forum.kirupa.com/t/volume-control-slider/304578 "2010-02-10T10:11:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![laur1](https://avatars.discourse-cdn.com/v4/letter/l/b77776/32.png) [@laur1](https://forum.kirupa.com/u/laur1)\
**Post date:** [February 10, 2010, 10:11am UTC](https://forum.kirupa.com/t/volume-control-slider/304578/1 "2010-02-10T10:11:35Z")

</div>

Hallo!

I make a volume control with this action

> onClipEvent (load) {  
> \_root.vbase.\_height = 65;  
> \_root.vbase.\_x = 37;  
> this.\_y = \_root.vbase.\_y+\_root.vbase.\_height/2-this.\_height/2;  
> left = this.\_x;  
> top = this.\_y+\_root.vbase.\_height/2;  
> right = this.\_x;  
> bottom = this.\_y-\_root.vbase.\_height/2;  
> //  
> volCalc = \_y+\_root.vbase.\_height/2;  
> }  
> // End of onClipEvent load  
> //  
> onClipEvent (enterFrame) {  
> // -----------------------------------------  
> volCalc2 = (\_y-volCalc)\*(-100/(\_root.vbase.\_height));  
> \_root.globalSound.setVolume(volCalc2);  
> \_root.currentVolumeText = "Volume: "+\_root.globalSound.getVolume();  
> // ------------------------------------------  
> this.onPress = function() {  
> startDrag(this, false, left, top, right, bottom);  
> }  
> this.onRelease = function() {  
> this.stopDrag();

}  
} // End of onClipEvent enterFrame  
My question is :  
how to do that when stopdrag to play a sound
