# Sound slider and volume tutorial?

**URL:** <https://forum.kirupa.com/t/sound-slider-and-volume-tutorial/196832>\
**Category:** Uncategorized\
**Created:** [August 11, 2006, 8:41am UTC](https://forum.kirupa.com/t/sound-slider-and-volume-tutorial/196832 "2006-08-11T08:41:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeTSm0keD](https://avatars.discourse-cdn.com/v4/letter/g/e480ec/32.png) [@GeTSm0keD](https://forum.kirupa.com/u/GeTSm0keD)\
**Post date:** [August 11, 2006, 8:41am UTC](https://forum.kirupa.com/t/sound-slider-and-volume-tutorial/196832/1 "2006-08-11T08:41:43Z")

</div>

im having problems makin a volume slider…

```auto

//----------------------------------------
loader.scrub.left = loader.scrub._x;
loader.scrub.right = loader.scrub.left+100;
loader.scrub.top = loader.scrub._y;
loader.scrub.bottom = loader.scrub._y;
loader.scrub._x = playerSound.getVolume();

volume_txt.text = playerSound.getVolume();
loader.scrub.onPress = function() {
    this.startDrag(false, this.left, this.top, this.right, this.bottom);
    this.isDragging = true;
};
loader.scrub.onMouseMove = function() {
    if (this.isDragging) {
        volume_txt.text = this._x;
    }
};
loader.scrub.onRelease = loader.scrub.onReleaseOutside=function () {
    stopDrag();
    isDragging = false;
    playerSound.setVolume(this._x);
};
//----------------------------------------

```

the volume keeps being displayed as 43 to 143  
or -173 to 21 depending where I put the MC on the stage

what am i doin wrong?
