# Volume knob jumps , plz advise

**URL:** <https://forum.kirupa.com/t/volume-knob-jumps-plz-advise/149449>\
**Category:** Uncategorized\
**Created:** [May 29, 2005, 11:21am UTC](https://forum.kirupa.com/t/volume-knob-jumps-plz-advise/149449 "2005-05-29T11:21:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jdexter](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@Jdexter](https://forum.kirupa.com/u/Jdexter)\
**Post date:** [May 29, 2005, 11:21am UTC](https://forum.kirupa.com/t/volume-knob-jumps-plz-advise/149449/1 "2005-05-29T11:21:35Z")

</div>

hi , i have a movie with a volume knob as a master volume , and it works good for one version , but not in the final version …

when the user clicks the lower right of the knob , it will " jump " to that position , bypassing the user’s “drag” and therefore making it very jerky and unprofessional .

i have this code , i was wondering ifanyone could help me so that only “drags” are recognized ? :

Action script :

/\*  
set maximum rotation of the knob.  
read initial volume of sound and set corresponding position of knob.  
_/  
onClipEvent(load){  
//maximum angle of rotation for the knob  
maxRotAngle = 120;  
//read the initial volume & set the position of the knob  
this.rotbutton.\_rotation = (2_\_root.s.getVolume() - 100)_maxRotAngle/100;  
//read the initial pan and set the position of the knob  
 [//this.rotbutton](https://this.rotbutton).\_rotation = \_root.s.getPan() \* maxRotAngle/100;  
}  
/_  
set the volume depending on the position of the knob  
use forumla to convert \_rotation into volume or pan range  
_/  
onClipEvent(enterFrame){  
if (rotbutton.dorotate) {  
\_root.s.setVolume(Math.floor((100+this.rotbutton.\_rotation/maxRotAngle_100)/2));  
//\_root.s.setPan(Math.floor((this.rotbutton.\_rotation/maxRotAngle\*100)));  
}  
//update readouts…  
\_root.sovolume = \_root.s.getVolume();  
\_root.dialangle = this.rotbutton.\_rotation;  
}
