home *** CD-ROM | disk | FTP | other *** search
- function getVisiblePercent()
- {
- var pct = maskedText.maskBlockCopy._height / maskedText.scrollpage._height;
- return pct;
- }
- function jumpToMouse(scrollbar)
- {
- var delta = _root._ymouse - scrollbar.start_mouse;
- delta *= 1 / (this._yscale / 100);
- var newY = scrollbar.start_drag + delta;
- jumpToY(scrollbar,newY);
- }
- function jumpToY(scrollbar, newY)
- {
- var maxY = scrollbar.max - scrollbar._height;
- if(newY < scrollbar.min)
- {
- newY = scrollbar.min;
- }
- if(maxY < newY)
- {
- newY = maxY;
- }
- scrollbar._y = newY;
- var pct = (newY - scrollbar.min) / (maxY - scrollbar.min);
- var range = maskedText.scrollpage._height - maskedText.maskBlockCopy._height;
- var offset = pct * range;
- maskedText.scrollpage._y = maskedText.scrollpage.orig_y - offset;
- }
- function scrollUpOneLine(scrollbar)
- {
- var thumbRange = scrollbar.max - scrollbar._height - scrollbar.min;
- var oneLine = thumbRange / 5;
- jumpToY(scrollbar,scrollbar._y - oneLine);
- }
- function scrollDownOneLine(scrollbar)
- {
- var thumbRange = scrollbar.max - scrollbar._height - scrollbar.min;
- var oneLine = thumbRange / 5;
- jumpToY(scrollbar,scrollbar._y + oneLine);
- }
- function downOnePage(scrollbar)
- {
- var onePage = scrollbar._height;
- jumpToY(scrollbar,scrollbar._y + onePage);
- }
- function upOnePage(scrollbar)
- {
- var onePage = scrollbar._height;
- jumpToY(scrollbar,scrollbar._y - onePage);
- }
- function scrollOnePage(scrollbar)
- {
- var scaled_y = scrollbar._y + scrollbar._height / 2;
- scaled_y *= this._yscale / 100;
- if(_root._ymouse < this._y + scaled_y)
- {
- upOnePage(scrollbar);
- }
- else
- {
- downOnePage(scrollbar);
- }
- }
- thumb.min = thumb._y;
- thumb.max = thumb._y + thumb._height;
- thumb._yscale = 100 * getVisiblePercent();
-