# Another volume slider question

**URL:** https://forum.kirupa.com/t/another-volume-slider-question/91853
**Category:** Uncategorized
**Created:** [October 9, 2003, 6:18pm UTC](https://forum.kirupa.com/t/another-volume-slider-question/91853 "2003-10-09T18:18:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![luthan](https://avatars.discourse-cdn.com/v4/letter/l/c6cbf5/32.png) [@luthan](https://forum.kirupa.com/u/luthan)
#### Post date: [October 9, 2003, 6:18pm UTC](https://forum.kirupa.com/t/another-volume-slider-question/91853/1 "2003-10-09T18:18:02Z")

</div>

Hi guys,  
I made the slider using the tutorial, which works great.

However, I want to make the slider so when the sound is started, the slider would start out in the middle of the slide bar, therefore 50% of the volume.  
from there the person can either make it louder or decrease the volume.

how can i accomplish this.

the following is the code in the slider clip:

this.ratio = 0;  
dragger.onPress = function() {  
this.startDrag(true, 0, 0, line.\_width, 0);  
this.onEnterFrame = function() {  
ratio = Math.round(this.\_x\*100/line.\_width);  
\_root.volume = ratio;

```
};

```

};  
dragger.onRelease = dragger.onreleaseOutside=stopDrag;

thanks in advance
