2 Replies Latest reply on Jul 21, 2006 9:17 AM by

    Scrolling Text (ticker bar)

      I am trying to create a scrolling ticker that rolls across the bottom of the page (like what you see on news channels). What I currently have works but it looks a little choppy. I use SetInterval for my ScrollTicker function, within that function I modify the ._x of the textbox (txtScrollBar._x -= 1). Is there a better way to do this? Oh also the way I do it I have to take the text and multiply it many many times so that it doesn't roll off the screen. Surely there's a way to "wrap" text horizontally so when the right edge runs out of text it starts at the begging of the string?

        • 1. Re: Scrolling Text (ticker bar)
          micahkoga Level 1
          For the "wrapping", one way to do it is to create each headline in a separate textfield, when one textfield goes off screen move it back to the starting side and continue the tween.

          You could also try the tween class:
          • 2. Re: Scrolling Text (ticker bar)
            Ok, I created a 2 dynamic textfields, when one falls off the left of the page (scrolling left) it moves off the page to the right side of the other text fields. This behaves the way I would expect, however, still a few problems.

            1) It is still a choppy scroll (it doesn't look smooth). I'm running the flash at 12fps and ScrollTicker() is called each frame (so 12 times per second). Each call to ScrollTicker() advances each textfield 1 pixel (txtField1._x -= 1, txtField2._x -= 1).
            2) You can tell where the 2 textfields join on the screen, they do not move in exact unison, even though I change their ._x value right next to eachother (2 lines of code).