I create the text field like this:
var textFormat:TextFormat = new TextFormat(Assets.getFont(“fonts/Akrobat-Regular.otf”).fontName, 40, 0xFFFFFF);
var textField:TextField = new TextField();
textField.type = TextFieldType.INPUT;
textField.wordWrap = false;
textField.selectable = true;
textField.multiline = false;
textField.embedFonts = true;
textField.text = “В знак благодарности мы Вам скидку 10%”;
textField.defaultTextFormat = textFormat;
textField.antiAliasType = AntiAliasType.NORMAL;
It seems that this bug appears only for the caret. At least I did not notice other bugs.
When I get the values of the input field (textField.text), I see the same value that is displayed on the screen.
Bugs are the same, not depending on whether the “Entered text” or “text specified by software” (ie, by equating textField.text = “lalalalala”)
For the experiment:
I equated textField.text = “1234567890” (For example, i took the numbers for simplicity, in fact, the numbers do not bug and in TextField i have some ciryllic symbols).
I added MouseEvent.CLICK listener to the text box.
When I click on zero, the caret is placed after it. But then when I start to press “BaсkSpase” the entry caret jumps to 5 but zero is deleted.
And one more interesting point: if I click at the end of the line, I get the caretIndex = 42, although there are only 3 characters in the line (it seems like the maximum number of characters per line), then the carriage is set correctly (after the last character), if you click on the last character then the carriage index = 3 and the carriage is set incorrectly.
In this case, if there is only one character in the line, then the carriage is set correctly.