# Need help computing scroll position

**URL:** <https://forum.kirupa.com/t/need-help-computing-scroll-position/201968>\
**Category:** flash\
**Created:** [September 26, 2006, 6:32pm UTC](https://forum.kirupa.com/t/need-help-computing-scroll-position/201968 "2006-09-26T18:32:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drzero](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@drzero](https://forum.kirupa.com/u/drzero)\
**Post date:** [September 26, 2006, 6:32pm UTC](https://forum.kirupa.com/t/need-help-computing-scroll-position/201968/1 "2006-09-26T18:32:50Z")

</div>

Hi;

I have a method that is called when someone drags the handle of my scroll bar. That method updates the position of the target Movie Clip (holder\_mc) that is being masked and scrolled. This method:

private function scrollContent():Void  
{  
var h = mcScrollBar.mcBg.\_height - 4 - mcScrollBar.mcHandle.\_height;  
var percent = Math.round(mcScrollBar.mcHandle.\_y/h \* 100)-1;

```
var contentH = holder_mc._height;
var newY = contentH*(percent/100);

holder_mc._y = -Math.round(newY);

```

}

There are circumstances where I will be manually updating the positon of the holder\_mc to a specific \_y position to simulate anchor tags. In this case, I need to update the position of the scroll handle to reflect the current \_y of the holder\_mc. I am having difficulty figuring out the math equations to update the scroll handle. Can anyone help?
