# Custom Scroller help

**URL:** https://forum.kirupa.com/t/custom-scroller-help/298276
**Category:** flash
**Created:** [October 15, 2009, 7:54pm UTC](https://forum.kirupa.com/t/custom-scroller-help/298276 "2009-10-15T19:54:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pbfro](https://avatars.discourse-cdn.com/v4/letter/p/91b2a8/32.png) [@pbfro](https://forum.kirupa.com/u/pbfro)
#### Post date: [October 15, 2009, 7:54pm UTC](https://forum.kirupa.com/t/custom-scroller-help/298276/1 "2009-10-15T19:54:38Z")

</div>

Hi all,

For some reason I’ve hit a wall on this. Trying to make a custom scroller which works but the odd thing is that when i drag the scroller to the bottom, the content scrolls the opposite way. So when the scroller is at its start point, the content is at its end point and when i scroll it to the end point the content reverses to the start point. Here is what I’m using

```auto
var scrollLower:Number = -92;
var scrollUpper:Number = 39;
var textLower:Number = -92;
var textUpper:Number = -140;
var scrollRange:Number = scrollLower - scrollUpper;
var textRange:Number = textLower - textUpper;

function scroll()
{
    var moved:Number = scroller_mc._y - scrollUpper;
    var perMoved:Number = moved/scrollRange;
    var textMoved:Number = perMoved*textRange;
    contentMain._y = textLower - textMoved;
}

scroller_mc.onPress = function()

{
    startDrag(this,false,this._x,-92,this._x,39);
    this.onMouseMove = scroll;
    
}
scroller_mc.onRelease = scroller_mc.onReleaseOutside = function()
{
    stopDrag();
    this.onMouseMove = null;
}

```
