Im loading text from XML into a dynamic textfield.multiline is true but the text doesn't wordwrap correct. Instead the text is cut off and the linebreak appears but at the wrong place.
This only happens if the text is leftaligned.
I just can't figure out a way to solve it.
Desperate for help.
The textfield is set to wordwrap, so that is not the problem.
The strange thing that if I set the text to be either center- or right aligned it wraps correctly. It also works if the the text is not anti-aliased.
But as I want the text to be leftaligned and anti-aliased for readability those are not good options.
The font is embedded and I use CDATA in the xml-tag to make it possible to use html-tags. I set the htmlText.
Is it a flashbug or are there any ways around this.
i've not enountered or seen anyone else that's encountered that problem so i doubt it's a flash bug. but it's possible.
create a new fla and duplicate the problem. then copy and paste the minimum amount of code needed to demonstrate the problem.
Do you have any special characters in the text? Like em dash or some special unicode characters? I've seen this in AS2 and earlier versions of Flash. I never found a solution, but it can give you some ideas of where to look — maybe.
I think you should set textfield property autosize to left.
like : txtfield.autoSize = TextFieldAutoSize.LEFT;
And if this not works, you can manually set the X property and width of the textfield on click event.
This could be the solution of your problem.
Setting the autoSize did not work.
I tried setting the width dynamicly so that it makes it 50 px less after the text is set, but that only cuts off more of the text it doesn't change the wordwrapping.
This is very confusing..