1 Reply Latest reply on May 16, 2006 5:58 PM by Newsgroup_User

    How to scroll text offscreen in TextInput

    JoChu
      Hi all,

      Presently, I'm trying to create a newsticker using the TextInput component. To create the horizontal scrolling effect, I'm changing the "horizontalscrollposition" property periodically. However, for text that's longer in length than the TextInput width, the scrolling would stop once the end of the text is visible. If the text is shorter than the TextInput width, there's no scrolling at all. In both cases, it would seem the "horizontalscrollposition" would just not accept new values. I assume this is the desired behavior for the TextInput component, but is there a workaround for this?

      Thanks in advance for your help.
      Jo
        • 1. Re: How to scroll text offscreen in TextInput
          Level 7

          Jo,

          TextInput and the underlying flash.text.TextField do not support the
          behavior you describe. You will need to come up with some workaround. Try
          putting the TextInput into a Canvas. First adjust the
          horizontalScrollPosition until it reaches the maxHorizontalScrollPosition.
          When that happens, then start moving the x position of the TextInput inside
          of your Canvas (make it smaller). At some point you'll need to wrap your
          TextInput back to the other side of the Canvas.

          We will be setting up a component exchange on the Flex website at some
          point. If you get this working, then you should consider posting it up
          there.

          --
          Jason Szeto
          Adobe Flex SDK Developer


          "JoChu" <webforumsuser@macromedia.com> wrote in message
          news:e4dntd$68o$1@forums.macromedia.com...
          > Hi all,
          >
          > Presently, I'm trying to create a newsticker using the TextInput
          > component. To
          > create the horizontal scrolling effect, I'm changing the
          > "horizontalscrollposition" property periodically. However, for text that's
          > longer in length than the TextInput width, the scrolling would stop once
          > the
          > end of the text is visible. If the text is shorter than the TextInput
          > width,
          > there's no scrolling at all. In both cases, it would seem the
          > "horizontalscrollposition" would just not accept new values. I assume this
          > is
          > the desired behavior for the TextInput component, but is there a
          > workaround for
          > this?
          >
          > Thanks in advance for your help.
          > Jo
          >