I want to make a custom alignment method for a TextField (of ‘input’ type).
The reason for this?
Let’s say I have a Text Field with 4 lines of text.
I want the first 2 to be ‘centered’, and the other 2 to stay unformated, no align.
With the standard way:
my_format.align=‘center’;
my_text_field.setTextFormat(my_format);
…the alignment gets aplied to the whole text (AND the 4 lines).
If I replace the scond line with: my_text_field.setTextFormat(selectionStart, selectionEnd, my_format); no alignmentis applied.
So I must make a custom align method, a snippet. How should start?