flashapache-flexactionscriptflex-sparkricheditabletext

Flex: TextFlow ignores whitespaces


i'm trying to add whitespaces in front of my text, but flex removes all but one whitespace from the text. So i can't format the text.

Here is the specified line:

<s:p> •  Lorem</s:p>
<s:p>    ipsulum</s:p>

Here its shown correctly but when running the swf it reduces the whitespaces of the second line. Of course i tried to use CDATA but this didn't work too.

Cheers Felix


Solution

  • You need to use:

    my_textFlow.whiteSpaceCollapse = WhiteSpaceCollapse.PRESERVE;
    

    Check the TextFlow Adobe reference for whiteSpaceCollapse for FlowElement.