Modifying scroller for movieclip control

Hello,

The last couple of days I’ve been juggling with a news reader in flash (from the example tutorial here on Kirupa), and this works perfectly. My eye however fell on the scroller that is applied in this newsreader. For my websites I’ve used several sripts for scrolling, but this one suits me the best, and I would like to use it on more occasions. However the “problem” is that in the newsreader the scroller is used for scrolling a dynamic text field. Ideally I would like to apply it for scrolling Movieclips (like I used to do with the scroller I used in the past). Although I understand actionscrpit to a moderate level, this is a little to much for me. the script used for the scroller is this:

// global functions
Clamp = function(min, n, max){
	if (n<min) return min;
	if (n>max) return max;
	return n;
}

// SCROLLBAR
// references
scrollbar.range = scrollbar._height;
scrollbar.top = scrollbar._y;


// methods
scrollbar.resize = function(size_factor){
	this.body._yscale = Clamp(0, 100*size_factor, 100);
	this.cap._y = this.body._y + this.body._height;
}
scrollbar.updateSize = function(){
	if (!this.contentCanScroll()) this.noScroll();
	else{
		var range = this.target.txt.bottomScroll-this.target.txt.scroll;
		this.resize(range/(this.target.txt.maxscroll+range));
	}
}
scrollbar.setBarScroll = function(percent){
	if (percent == 0) this._y = this.top;
	else{
		var bottom = this.top + (this.range - this._height);
		var position = this.top + (this.range - this._height)*percent
		this._y = Clamp(this.top, position, bottom);
	}
}
scrollbar.getBarScroll = function(){
	return (this._y - this.top)/(this.range - this._height);
}
scrollbar.updateBarScroll = function(){
	this.updateSize();
	this.setBarScroll((this.target.txt.scroll-1)/(this.target.txt.maxscroll-1));
}
scrollbar.updateContentScroll = function(){
	if (!this.contentCanScroll()) this.noScroll();
	else this.target.txt.scroll = 1+Math.round((this.target.txt.maxscroll-1)*this.getBarScroll());
	this.target.last_scroll = this.target.txt.scroll;
}
scrollbar.setScroll = function(percent){
	this.setBarScroll(percent);
	this.updateContentScroll();
}

scrollbar.noScroll = function(){
	this.target.txt.scroll = 1;
	this._y = this.top;
	this.resize(1);
}

// checks
scrollbar.contentCanScroll = function(){
	return (this.target.txt.maxscroll > 1);
}
scrollbar.contentChanged = function(){ // checker/reactor
	if (this.target.txt.text != this.target.content ){
		this.target.content = this.target.txt.text;
		this.updateBarScroll();
	}else if (this.target.last_scroll != this.target.txt.scroll){
		this.target.last_scroll = this.target.txt.scroll;
		this.updateBarScroll();
	}
}

// interaction
scrollbar.drag = function(){
	if (this.body._yscale >= 100) return (0);
	var position = this._parent._ymouse - this._yoffset;
	var bottom = this.top + this.range - this._height;
	this._y = Clamp(this.top, position, bottom);
	this.updateContentScroll();
	updateAfterEvent();
}
scrollbar.onPress = function(){
	this._yoffset = this._ymouse;
	this.onMouseMove = this.drag;
}
scrollbar.onRelease = scrollbar.onReleaseOutside = function(){
	delete this.onMouseMove;
}

// define
scrollbar.setTarget = function(txt){
	this.target = {
		txt: txt,
		content: this.target.txt.text,
		last_scroll: this.target.txt.scroll
	}
	this.resize(txt.scroll/txt.maxscroll);
}
// poll for content changes
scrollbar.onEnterFrame = scrollbar.contentChanged;

The example of the scroller can be found here. And the flash file is uploaded [URL=“http://www.xs4all.nl/~karhen/Kirupa/Kirupa%20Example.fla”]here. The scroller adjusts its height according to the amount of text that is displayed in the textbox. To transform the scroller towards my idea you would have to link the height from the movieclip and the mask (the displayed area). I don’t even know if this is possible at all, but it would be sweet, because the scroller functions very nice. Hope someone can help me, because I’m to much of an actionscript n00b to adjust the code myself.

Thanks…