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…
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!