Hi!
I am using a scollbar with a dynamic loaded text.
Everything seems to look ok at first but then i noticed that if you release the scroll button before the end of the text and you try to scroll again the scrollbar will not show the entire text… well it’s not easy to explain so i’ll attach the fla.
You can see it here too: http://www.soromenho.net/scroll/scroll.swf
It doesn’t always happen… sometimes you have to release the scroll more than once and drag it again…
i’ll also post the code here:
scrolling = function ()
{
var scrollht:Number = scrolltrack._height;
var boxht:Number = scrollbox._height;
var scrollarea:Number = scrollht-boxht;
var ms:Number = loadedInfo.maxscroll;
var scale:Number = (ms-1)/scrollarea;
var ypos:Number = scrolltrack._y;
var textpos:Number = loadedInfo.scroll;
var left:Number = scrolltrack._x;
var top:Number = scrolltrack._y;
var right:Number = scrolltrack._x;
var bottom:Number = (scrolltrack._y+(scrollht-boxht));
var ymove:Number = 0;
var textmove:Number = 0;
scrollbox._y = ypos;
scrollbox.onPress = function()
{
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function()
{
ymove = (ypos-this._y);
textmove = (Math.round(ymove*scale));
loadedInfo.scroll = textpos - textmove;
// "loadedInfo" is the name of the dynamic textfield
if(this._y == 0){
loadedInfo.scroll = 1;
}
};
scrollbox.onMouseUp = function()
{
stopDrag();
delete this.onMouseMove;
ypos = this._y;
textpos = loadedInfo.scroll;
};
};
if (ms==1)
{
scrollbox._visible = false;
scrolltrack._visible = false;
}
else
{
scrollbox._visible = true;
scrolltrack._visible = true;
}
};
any help would be really appreciated!
thanks everybody! i’m trying to solve this for hours!