The following example shows how you can control the text spacing on justified text on the Flex Gumbo FxTextArea control by setting the textJustify style.
Full code after the jump.
The textJustify style was added in Flex Gumbo build 4285 (4.0.0.4285). Click here to download the latest version of the Flex Gumbo SDK.
To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see “Using the beta Gumbo SDK in Flex Builder 3″.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/12/15/controlling-text-justification-on-a-fxtextarea-control-in-flex-gumbo/ -->
<Application name="FxTextArea_textJustify_test"
xmlns="http://ns.adobe.com/mxml/2009"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<ApplicationControlBar dock="true">
<Form styleName="plain">
<FormItem label="textAlign:">
<ComboBox id="comboBox1"
dataProvider="[start,end,left,center,right,justify]"
selectedIndex="5" />
</FormItem>
<FormItem label="textAlignLast:">
<ComboBox id="comboBox2"
dataProvider="[start,end,left,center,right,justify]" />
</FormItem>
<FormItem label="textJustify:">
<ComboBox id="comboBox3"
dataProvider="[distribute,interWord]" />
</FormItem>
<FormItem label="width:">
<HSlider id="slider"
minimum="50"
maximum="100"
value="100"
snapInterval="1"
tickInterval="2"
liveDragging="true" />
</FormItem>
</Form>
</ApplicationControlBar>
<FxTextArea id="textArea"
textAlign="{comboBox1.selectedItem}"
textAlignLast="{comboBox2.selectedItem}"
textJustify="{comboBox3.selectedItem}"
fontSize="24"
marginBottom="40"
percentWidth="{slider.value}"
height="100%">
<content>
<String source="data/lorem.html" />
</content>
</FxTextArea>
</Application>
View source is enabled in the following example.
This entry is based on a beta version of the Flex Gumbo SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex Gumbo SDK.
