Link to home
Avatar of pepenuro
pepenuro

asked on

Scroll buttons that scroll continuously on mouse_down

Hi there,

Would anyone have a script for scroll buttons that scroll continuously whilst the mouse is down?
Not sure if I have to use a onEnterFrame type function.

The text is not dynamic, so there is no need to include the load function for that.

Cheers,
Avatar of go4ejjohn
go4ejjohn

do you want the scroll bar to move down on a button press? Cloud you please elaborate please .

JON
Avatar of pepenuro

ASKER

Hi there,

No ned for a scroll bar, theres only 2 buttons (one up and one down).
It's only the content (a movie clip containing a text field) that needs to move continuously.

Thanks,
Pepe
You need to textfield class for this purpose. there are API to find out the maxscroll in height and in width of the textfield. The minimum value will start from 0 and till the maxinm from that API. Which will return you the integer. you also need the current position.

maxScrollH():
maxScrollV():

in one button you increment it from current to the max you get and in another reduce it from current to 0....

Regards,
JON
Thanks again Jon,

I actually have been able to get it to scroll already but what I'm most interested in is the part of the script that would make the text or MC scroll continuously whilst the buttons are being pressed (MOUSE_DOWN).

Regards,
Pepe
ok, let me understand you. you are looking for a continues scroll movement when mouse is pressed ?
In that case you need a variable global that sets the status 0,1,2 in which 0 is for no movement, 1 is for up movement and 2 is for down movement.
and use a enterframe or setinteraval and then make write your scroll code in the enterframe or setinterval.
If you want actual code will take some to free my self to write that for you. may be in the evening my time...

JON
Hi Jon,

Any suggestions would be useful to be honest.
I figured using a onenterframe type event would work but thought there might be a more cpu-resource friendly way of doing it.

Cheers,
Pepe
ASKER CERTIFIED SOLUTION
Avatar of go4ejjohn
go4ejjohn

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial