# Volume Control

**URL:** https://forum.kirupa.com/t/volume-control/193819
**Category:** Uncategorized
**Created:** [July 18, 2006, 5:19pm UTC](https://forum.kirupa.com/t/volume-control/193819 "2006-07-18T17:19:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![habes](https://avatars.discourse-cdn.com/v4/letter/h/e5b9ba/32.png) [@habes](https://forum.kirupa.com/u/habes)
#### Post date: [July 18, 2006, 5:19pm UTC](https://forum.kirupa.com/t/volume-control/193819/1 "2006-07-18T17:19:58Z")

</div>

HI everyone, im working on a volume control slider with the following code:  
this.ratio = 0;

```php
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;

```

how can you make it start at half volume?
