Scroller buttons

I just wanted to know how to make content in a dynamic text box scroll continuously, right now you can only click on the up to move it up a bit, and down to move it down a bit etc. I want the user to be able to hold down the button to make the content scroll. Could anyone help me with this please?
Thanks in advance!

the code on the up button:

on (release) {
	contentArea.scroll-=1;
}

the code on the down button:

on (release) {
 contentArea.scroll += 1;
}

contentArea is the instance name of my dynamic text box. :slight_smile:

if you make the scroll buttons into to MCs…this will work:

up button:


on (press) {
	this.onEnterFrame = function() {
		_root.contentText.scroll -= 1;
		
	};
}
on (release) {
	delete this.onEnterFrame;
}

down button:


on (press) {
	this.onEnterFrame = function() {
		_root.contentText.scroll += 1;
		
	};
}
on (release) {
	delete this.onEnterFrame;
}

Thanks.
Are you meant to put the actionscript code in the movie clip itself?
I just tried it and it doesn’t seem to work at all.

Make each scroll button its own movieclip and put the code on the actual movie clips, not the timeline.

Hmm I just tried that too and it doesnt work. maybe something is missing? do i have to get rid of my old actionscript coding as well? cos i tried with and without but it still doesn’t work

bump (sorry for bumping my post… just that i really need some help here!!)

try this, it’s better anyways, you can adjust the speed of scroll independent of the FPS speed:

Turn your button into a movieClip and apply the folloing code:

onClipEvent(enterFrame){
this.scroll -=1;
}

Then +=1; for the other button.

Regards,

fraggs, that wouldn’t target the text…that ‘this’ would target the MC button its self, even if you did target the text, that would scroll infinitely with no relent, with pressing anything at that… :h:

Macneilslt, thanks! I looked at your .fla file and changed mine in the same way, and now it finally works, yay :slight_smile:
Thanks to everyone as well for your help :slight_smile: