# Scroller help

**URL:** https://forum.kirupa.com/t/scroller-help/26228
**Category:** Uncategorized
**Created:** [July 21, 2003, 5:28am UTC](https://forum.kirupa.com/t/scroller-help/26228 "2003-07-21T05:28:35Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![emeX](https://avatars.discourse-cdn.com/v4/letter/e/a4c791/32.png) [@emeX](https://forum.kirupa.com/u/emeX)
#### Post date: [July 21, 2003, 5:28am UTC](https://forum.kirupa.com/t/scroller-help/26228/1 "2003-07-21T05:28:35Z")

</div>

## 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…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 6:41am UTC](https://forum.kirupa.com/t/scroller-help/26228/2 "2003-07-21T06:41:33Z")

</div>

Would this help?

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 1:42pm UTC](https://forum.kirupa.com/t/scroller-help/26228/3 "2003-07-21T13:42:54Z")

</div>

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???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 2:39pm UTC](https://forum.kirupa.com/t/scroller-help/26228/4 "2003-07-21T14:39:00Z")

</div>

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. 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 3:14pm UTC](https://forum.kirupa.com/t/scroller-help/26228/5 "2003-07-21T15:14:02Z")

</div>

Kode i couldnt get tht to work [heres the fla](http://www.zero-dream.com/files/test.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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 3:18pm UTC](https://forum.kirupa.com/t/scroller-help/26228/6 "2003-07-21T15:18:15Z")

</div>

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

Anyway, I’ll check your FLA. 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 3:21pm UTC](https://forum.kirupa.com/t/scroller-help/26228/7 "2003-07-21T15:21:48Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 3:28pm UTC](https://forum.kirupa.com/t/scroller-help/26228/8 "2003-07-21T15:28:25Z")

</div>

The thing is, you don’t actually need that autoScroll code… 😛  
[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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 3:41pm UTC](https://forum.kirupa.com/t/scroller-help/26228/9 "2003-07-21T15:41:08Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 3:50pm UTC](https://forum.kirupa.com/t/scroller-help/26228/10 "2003-07-21T15:50:58Z")

</div>

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

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. 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 4:02pm UTC](https://forum.kirupa.com/t/scroller-help/26228/11 "2003-07-21T16:02:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 21, 2003, 4:06pm UTC](https://forum.kirupa.com/t/scroller-help/26228/12 "2003-07-21T16:06:17Z")

</div>

You’re welcome. =)
