# What's with

**URL:** https://forum.kirupa.com/t/whats-with/117949
**Category:** Uncategorized
**Created:** [August 1, 2004, 9:09am UTC](https://forum.kirupa.com/t/whats-with/117949 "2004-08-01T09:09:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ctrl\_Z](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Ctrl\_Z](https://forum.kirupa.com/u/Ctrl_Z)
#### Post date: [August 1, 2004, 9:09am UTC](https://forum.kirupa.com/t/whats-with/117949/1 "2004-08-01T09:09:20Z")

</div>

my scroll bar?

[http://ctrlzproduction.com/flash/m1r-04/m1r-04.html](http://ctrlzproduction.com/flash/m1r-04/m1r-04.html)

it’s a drop in compent and it sticks or something

thanks

this is the code on the scrollbar but not all of it

```auto
FScrollBarClass.prototype.setScrollTarget = function(tF)
{
	if (tF == undefined) {
		this.textField.removeListener(this);
		delete this.textField[(this.horizontal) ? "hScroller" : "vScroller"]; 
		if (!(this.textField.hScroller==undefined) && !(this.textField.vScroller==undefined)) {
			this.textField.unwatch("text");
			this.textField.unwatch("htmltext");
		}
	}
	this.textField = undefined;
	if (!(tF instanceof TextField)) return;
	this.textField = tF;
	this.textField[(this.horizontal) ? "hScroller" : "vScroller"] = this; 
	this.onTextChanged();
	this.onChanged = function()
	{
		this.onTextChanged();
	}
	this.onScroller = function()
	{
		if (!this.isScrolling) {
			if (!this.horizontal) {
				this.setScrollPosition(this.textField.scroll);
			} else { 
				this.setScrollPosition(this.textField.hscroll);
			}
		}
	}
	this.textField.addListener(this);
	this.textField.watch("text", this.callback);
	this.textField.watch("htmlText", this.callback);
}

FScrollBarClass.prototype.callback = function(prop, oldVal, newVal)
{
	clearInterval(this.hScroller.synchScroll);
	clearInterval(this.vScroller.synchScroll);
	this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
	this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
	return newVal;
}

FScrollBarClass.prototype.onTextChanged = function()
{
	if (!this.enable || this.textField==undefined) return;
	clearInterval(this.synchScroll);
	if (this.horizontal) {
		var pos = this.textField.hscroll;
		this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
		this.setScrollPosition(Math.min(pos, this.textField.maxhscroll));
	} else {
		var pos = this.textField.scroll;
		var pageSize = this.textField.bottomScroll - this.textField.scroll;
		this.setScrollProperties(pageSize, 1, this.textField.maxscroll);
		this.setScrollPosition(Math.min(pos, this.textField.maxscroll));
	}
}

```
