Scrolling Text Programmatically : Scroll « TextField « Flash / Flex / ActionScript






Scrolling Text Programmatically

 

package {

  import flash.display.Sprite;
  import flash.text.TextField;
  public class Main extends Sprite {
    public function Main(  ) {
      var field:TextField = new TextField(  );
   
        field.scrollV = 1;   // Scroll to the top
        field.scrollV += 1;  // Scroll to the next line
        field.scrollV = 6;   // Scroll to line 6
        
        field.autoSize = flash.text.TextFieldAutoSize.LEFT;
        field.wordWrap = true;
        field.text = "AAA BBB CCC DDD AAA BBB CCC DDD AAA BBB CCC DDD AAA BBB CCC DDD";
        addChild(field);
    }
  }
}

        








Related examples in the same category

1.Set the scroll related properties
2.Set horizontal scroll value
3.Responding to Scroll Events
4.Using the Scroll Properties