Customized scroll bar

[FONT=Lucida Sans Unicode]Hello peeps, any ideas on what went wrong? [/FONT]
[FONT=Lucida Sans Unicode][/FONT]
[FONT=Lucida Sans Unicode]I have been attempting to create a simple scroll-bar following the tutorials from kirupa.com. After I have exported the flash file, it came up with errors saying this: [/FONT]
[FONT=Lucida Sans Unicode][/FONT]
[FONT=Lucida Sans Unicode]Statement must appear within on/onClipEvent handler Statement (source) scrolling = function ()}[/FONT]
[FONT=Lucida Sans Unicode][/FONT]
Statement must appear within on/onClipEvent handler (source) scrolling();

thnx

what is easier: scroll bar using a masking tool or dynamic text. is there any difference?

Here’s an AS3 text scrollbar, with TweenMax easing, and link to external text file.
I have no clue how to do it AS2.

import gs.TweenMax;
import fl.motion.easing.*;

function loadText():void {
	var txtLoader:URLLoader = new URLLoader();
	txtLoader.addEventListener(Event.COMPLETE, onLoaded);
	txtLoader.load(new URLRequest("pharetra.txt"));
	removeEventListener(Event.COMPLETE, onLoaded);

	function onLoaded(e:Event):void {
		content.text = txtLoader.data;
	}
}

loadText();

var yOffset:Number;
var yMin:Number = 0;
var yMax:Number = sb.track.height - sb.thumb.height;

sb.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDown);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbUp);

function thumbDown(e:MouseEvent):void {
	stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
	yOffset = mouseY - sb.thumb.y;
}

function thumbUp(e:MouseEvent):void {
	stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMove);
}

function thumbMove(e:MouseEvent):void {
	sb.thumb.y = mouseY - yOffset;
	if (sb.thumb.y <= yMin) {
		sb.thumb.y = yMin;
	}
	if (sb.thumb.y >= yMax) {
		sb.thumb.y = yMax;
	}
	var sp:Number = sb.thumb.y / yMax;
	TweenMax.to(content, 1, {y:(-sp*(content.height - masker.height)), ease:Back.easeOut});
	e.updateAfterEvent();
}