# Volume control wheel - need help

**URL:** <https://forum.kirupa.com/t/volume-control-wheel-need-help/182957>\
**Category:** flash\
**Created:** [March 22, 2006, 7:41pm UTC](https://forum.kirupa.com/t/volume-control-wheel-need-help/182957 "2006-03-22T19:41:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fr\_ode](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fr\_ode](https://forum.kirupa.com/u/fr_ode)\
**Post date:** [March 22, 2006, 7:41pm UTC](https://forum.kirupa.com/t/volume-control-wheel-need-help/182957/1 "2006-03-22T19:41:58Z")

</div>

I’m making a volume control wheel, sort of like iPod. I’ve been working on it some hours now and everything seems perfectly logical in my code. However, it does not work in real life. I can’t figure out what I’m doing wrong. Can someone help me out?

here’s my code, and the fla is attached.

```auto

onClipEvent (mouseDown) {
    var current_vol = position_vol;
    var current_vol = getProperty(this.drag_layer, _rotation);
}
onClipEvent (mouseMove) {
    position_vol = getProperty(this.drag_layer, _rotation);
    var tmpPosition = Number(position_vol)+180;
    var tmpCurrent = Number(current_vol)+180;
    var Movement = tmpPosition-tmpCurrent;
    if (Movement>1) {
        Movement = -1;
    } else if (Movement<-1) {
        Movement = 1;
    }
    Movement = Movement/360;
    var vol = current_vol+Movement;
    position_vol = position_vol;
    if (vol<0) {
        vol = 0;
    }
    if (vol>100) {
        vol = 100;
    }
    thevolume = Math.round(vol);
    this._parent.volX.text = thevolume;
    _parent.mySound.setVolume(thevolume);
}

/*

//rotate back
onClipEvent (mouseUp) {
    pos = getProperty(this.drag_layer, _rotation);
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var rotate_back:Tween = new Tween(this, "_rotation", Regular.easeOut, pos, 0, 10, false);
}

*/

```

cheers:gm:
