Here you need to do manipulations by doing try and error. You need to find out for how long word it happens and at
what letter it wraps into next line. After more and more analysis you will get for exact what letter it happens and then
you can manually add hyphen at that location.
Hope you understood!!!
1 person found this helpful
This may help you
It's written in C but it's easy enough to figure out how to write in actionscript.
I think your simplest bet would be to use mx:label and use the op
tion truncateToFit="true". Also adjust the width so that the text appears prope
rly. Hope this helps..!!
If nothing else works, try inserting the hyphen yourself when the data goes into the component.
You could use methods of the TextField class to get the number of lines, examine each line of text, and then insert a hyphen if conditions are met (in your case, if there is no space between the character at the end of a line and the character at the beginning of the next line).
Due to the fact that I do not use a fixed width font here, rtalton's suggestion makes the most sense to me.
With the TextField class methods I'll check what the last character of each line is and if it is not a white space or a hyphen, I'll just insert a hyphen.