Setting the Insertion Point in a Text Field : Focus : TextField Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » TextField » Focus »

 

Setting the Insertion Point in a Text Field


 


package {

  import flash.display.Sprite;
  import flash.text.TextField;
  public class Main extends Sprite {
    public function Main(  ) {
      var field:TextField = new TextField(  );
    
        stage.focus = field;                  // Set the focus to the text field
        field.text = "this is example text";  // Set the text value
        field.setSelection(00);
        
        
        trace(field.caretIndex);
        addChild(field);
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo TextField
» Focus