Given an editable TLFTextField
named tf
, you can enable focus with:
import flashx.textLayout.edit.EditManager;
tf.textFlow.interactionManager = new EditManager();
tf.textFlow.interactionManager.selectRange(0, 0);
tf.textFlow.interactionManager.setFocus();
Using this method, the text field is focused ready to receive input from the keyboard; however, the cursor will not blink. Therefore, there's no visual indication of focus.
TLFTextFields
are not optimal for user input. Consider using TextField
or TextArea
instead.