Skip to main content
Inspiring
October 5, 2006
Question

automatic scrolling

  • October 5, 2006
  • 2 replies
  • 154 views
I am sure this is an easy process, can someone assist me with the code to make my dynamic text box automatically scroll?

I have gotten this far, but can't think of what to do next.
onEnterFrame = function(){
this.ongoingEvents_txt.scroll -=10;
}

any suggestions are much appreciated. Thanks.
This topic has been closed for replies.

2 replies

Inspiring
October 5, 2006
Thanks for the quick response. That worked. Have a great day.
Inspiring
October 5, 2006
fbcojman,

> I am sure this is an easy process, can someone
> assist me with the code to make my dynamic text
> box automatically scroll?

Sure. I'll try.

> I have gotten this far, but can't think of what to do
> next.
> onEnterFrame = function(){
> this.ongoingEvents_txt.scroll -=10;
> }

The way you've got it, you're scrolling up -- and rather quickly, at
that. (At a default framerate of 12fps, that's 120 lines per second).
Assuming you've provided more text than the text field can hold, and that
it's set to multiline, and assuming your text starts at the beginning and
you want to scroll down (not up), try this ...

ongoingEvents_txt.text = "lengthy text here";
this.onEnterFrame = function() {
ongoingEvents_txt.scroll++;
// or ...
// ongoingEvents_txt.scroll += 1;
}

You may want to compare that TextField.scroll value against
TextField.maxscroll for the same instance, in order to stop the onEnterFrame
loop once the field has hit bottom.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."