Scroller help

i am having problems with the scroller. I have autoscroller that automatically shifts everything down one when it reaches the bottom of the dynamic text field. but i am trying to also have one up and down button so that i can go up and down at will. but i cant seem to get thsi to work right… is the autoscroller conflicting??
heres the code for the dynamic box named console i need to 2 buttons one up and one down to work…

onClipEvent (load) {
// prototype
TextField.prototype.autoScroll = function(ms) {
aScroll = function(field) {
field.scroll == field.maxscroll ? field.scroll : field.scroll++;
};
this.field = this;
this.interval = setInterval(aScroll, ms, this.field);
};
// usage
Console.autoScroll(100);

stop();
}
onClipEvent(load) {
Console.text=“Welcome”;
Console.text+="
test… “;
}
on (keyPress “<Enter>”) {
Console.text+=_parent.Input.text;
Console.text+=”
“;
_parent.Input.text=”";
}

Thanks a bunch…

Would this help?

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22935&highlight=scroll+buttons

nope that didnt work… i have this autoscroll thing goin so i dunno if its conflicting with my up and down buttons or what. ive tried everything i would post the fla but its too big to post…
Whats the easiest way to get a dymic text field to scroll with custom up and down buttons???

Yeah, it might be conflicting…
[AS]TextField.prototype.autoScroll = function(interval) {
this.$scroller = function() {
this.scroll != this.maxscroll ? this.scroll++ : this.scroll=0;
updateAfterEvent();
};
this.$interval = setInterval(this, “$scroller”, interval);
};
TextField.prototype.stopScroll = function() {
if (this.$interval) clearInterval(this.$interval), delete this.$interval;
if (this.$scroller) delete this.$scroller;
};
//
myTextField.autoScroll(interval);
myTextField.stopScroll();[/AS]
OK… added a stopScroll method. Whenever you want to scroll the TextField with your buttons, you call the method. :slight_smile:

Kode i couldnt get tht to work heres the fla could u please get the scroll buttons to work on this… cause when i put that code u told me to put in it didnt autoscroll anymore also by autoscroll i mean once the dynamic text field box reaches the bottom it shifts all the text up one line. I didnt know if u understood me correctly.
Thanx a bunch.

I do know what you mean… I wrote the autoScroll code you’re using. :stuck_out_tongue:

Anyway, I’ll check your FLA. :wink:

i edited it a bit though i took the line
“field.scroll == field.maxscroll ? field.scroll = 0: field.scroll++;”
and changed it to:
“field.scroll == field.maxscroll ? field.scroll : field.scroll++;”
b/c before it would keep goin continously i wanted to only scroll down if the user input more text than the dynamic text field could display that code segment enabled it to do that…

The thing is, you don’t actually need that autoScroll code… :stuck_out_tongue:
[AS]onClipEvent (load) {
Console.text = “Welcome”;
Console.text += "
test… ";
}
on (keyPress “<Enter>”) {
Console.text += “\r”+_parent.Input.text;
Console.scroll = Console.maxscroll;
_parent.Input.text = “”;
}[/AS]
That would do.

lol man i feel dumb…
But what coding do i put for the buttons to make them scroll??
I know there are many methods but what the best one?

If you want to scroll the TextField continuosly while the Button is pressed, check the link Freddy posted. :wink:

Otherwise…
[AS]// scroll up
on (release, keyPress “<Up>”) {
login1.console.scroll–;
}
// scroll down
on (release, keyPress “<Down>”) {
login1.console.scroll++;
}[/AS]
If I remember correctly, you had several events for you Buttons, I didn’t write them in the code above because I don’t remember which handlers you were using, not because you shouldn’t use them. :wink:

Thanks Kode for the help i appriciate it man :beam:

You’re welcome. =)