3 Replies Latest reply on Mar 16, 2007 7:34 AM by 187_2007

    scrolling label

    187_2007 Level 1
      I have text that is way too big for the label box. I want to make it auto scroll. Any ideas of better solutions?
        • 1. scrolling label
          phi2265 Level 1
          I like that idea... here's how you can do it..

          Make a timer and use the timer tick to display a substring of the string that is too long, and have the substring change +1 with each completion of the timer.

          I've done scrolling text with a timer and a move effect, but what I have above is a much better idea. I would have done that had I thought of it then...

          EDIT: That might be possible with Tween also.. but I haven't had much luck with finding any sort of code for Tween so I'm not sure how that works.



          • 2. Re: scrolling label
            187_2007 Level 1
            I'll give that a shot and post my results/frustrations here :)
            • 3. Re: scrolling label
              187_2007 Level 1
              AWESOME!!! IT worked... Okay here is what I did.

              First: I declared 2 global variables From and To both ints.

              public var From:Int;
              public var To:int;

              Then below I did this:


              public function timerFunction():void{
              From = 0;
              To = 15;
              var minuteTimer:Timer = new Timer(400, 20);
              minuteTimer.addEventListener(TimerEvent.TIMER, onTick);
              minuteTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
              minuteTimer.start();
              }
              public function onTick(evt:TimerEvent):void
              {
              importLabel0.text = ImportReturnMessage.substr(From,To); //this is my flex label further down in my code
              From++;
              To++;
              }
              public function onTimerComplete(evt:Event):void
              {
              timerFunction();
              }

              Thanks for the boot in the right Direction!!!!!!!