2 Replies Latest reply on Oct 5, 2006 6:51 AM by fbcojman

    automatic scrolling

    fbcojman Level 1
      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.
        • 1. Re: automatic scrolling
          Level 7
          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."


          • 2. Re: automatic scrolling
            fbcojman Level 1
            Thanks for the quick response. That worked. Have a great day.