Little scrollbar question

this is the code i’m using now for my up scroll bar:

on (press, release, keyPress “<Up>”) {
currentScroll = scrollableText.scroll;
if (Number(currentScroll)>1) {
scrollableText.scroll = currentScroll-1;
}
}

and i was wondering if you can make it so if you hold down the mouse, it will continue to scroll down. Will you be able to change the scroll speed? thx

the best bet would to make this scroll bar encapelated into an MC…

just turn your buttons etc. into 1 movie clip. then you could set a variable like

isScrolling = true; (or false if false);

and have code in the onClipEvent of that MovieClip to make it move up or down etc…

hope this helps some =)

If you use <B>MX</B> You can try something like this on a movie clip…

on (press, keyPress "<Up>") {
	currentScroll = scrollableText.scroll;
	this.onEnterFrame = function() {
		if (Number(currentScroll)>1) {
			scrollableText.scroll = currentScroll-1;
		}
	};
}

Untested, but it’s worth a try.

Yes what he said. lol

Lol… you never know, I am too lazy to set up the situation myself, so I don’t know if the code works or not…LOL :evil::beam:

argh! it doesn’t work for some reason! oh well, i guess i’ll wait till ig et a book and i’ll figure it myself…thx for the help anywayz :slight_smile: