# Get perfect scroll percentage

**URL:** https://forum.kirupa.com/t/get-perfect-scroll-percentage/298665
**Category:** Uncategorized
**Created:** [October 22, 2009, 5:12pm UTC](https://forum.kirupa.com/t/get-perfect-scroll-percentage/298665 "2009-10-22T17:12:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![log](https://avatars.discourse-cdn.com/v4/letter/l/e480ec/32.png) [@log](https://forum.kirupa.com/u/log)
#### Post date: [October 22, 2009, 5:12pm UTC](https://forum.kirupa.com/t/get-perfect-scroll-percentage/298665/1 "2009-10-22T17:12:52Z")

</div>

i want get scroll percentage form 0 to 250 point having a Line large 95px and dragger large 10px. I make this script but it dont perfect to get value. It’s fast to update value.

EXAMPLE HERE  
[http://megaswf.com/view/bf8c19e0a076b297897386a8d733ba9f.html](http://megaswf.com/view/bf8c19e0a076b297897386a8d733ba9f.html)

dragger.onPress = function() {  
dragger.startDrag(false, 0, -14, line.\_width-dragger.\_width, -14);  
this.onEnterFrame = updateValue;  
this.onMouseMove = updateEvent;  
};  
function updateEvent() {  
updateAfterEvent();  
}  
dragger.onRelease = dragger.onReleaseOutside=function () {  
dragger.stopDrag();  
delete this.onEnterFrame();  
this.onMouseMove = “”;  
};  
function updateValue() {  
var drag\_x, max\_x;  
drag\_x = dragger.\_x;  
max\_x = line.\_width-dragger.\_width;  
\*\* perc = Math.max(min\_value, Math.ceil((drag\_x/max\_x\*max\_value)));\*\*  
\_root.perc = perc;  
}  
//  
max\_value = 250;  
min\_value = 0;  
updateValue();

HOPE your reply soon. thank you

I attach fla.
