# Custom Scrollbar HELL

**URL:** <https://forum.kirupa.com/t/custom-scrollbar-hell/215338>\
**Category:** flash\
**Created:** [February 6, 2007, 3:24pm UTC](https://forum.kirupa.com/t/custom-scrollbar-hell/215338 "2007-02-06T15:24:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![W84me](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/w84me/32/1257_2.png) [@W84me](https://forum.kirupa.com/u/W84me)\
**Post date:** [February 6, 2007, 3:24pm UTC](https://forum.kirupa.com/t/custom-scrollbar-hell/215338/1 "2007-02-06T15:24:16Z")

</div>

Hi all!

I am trying to make my own text scrollbar with dragger. I dont want up or down buttons just the dragger. I ve done this so far…

```auto
var scrollHeight:Number = scrollTrack._height;
var ms:Number = newsText.maxscroll;
var left = scrollTrack._x;
var right = scrollTrack._x;
var top = scrollTrack._y;
var bottom = scrollTrack._height-scrollBut._height+top;
var down:Boolean = true;
scrollBut.onPress = function() {
    startDrag(this, true, left, top, right, bottom);
    this.onMouseMove = function() {
        if (newsText.scroll>0) {
            if (down == true) {
                newsText.scroll++;
            }
        }
        if (newsText.scroll == ms) {
            down = false;
            trace(down);
            if (down == false) {
                newsText.scroll--;
            }
        }
    };
};
scrollBut.onMouseUp = function() {
    stopDrag();
    delete this.onMouseMove;
};

```

It scrolls till the end of text but not to the beginning…

Thanks in advance!
