Setting the line height on an FxTextArea control in Flex Gumbo

by Peter deHaan on November 4, 2008

in FxTextArea, beta

The following example shows how you can set the line height on a Flex Gumbo FxTextArea control by setting the lineHeight style.

Full code after the jump.

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″.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/11/04/setting-the-line-height-on-an-fxtextarea-control-in-flex-gumbo/ -->
<FxApplication name="FxTextArea_lineHeight_test"
        xmlns="http://ns.adobe.com/mxml/2009">
    <layout>
        <VerticalLayout />
    </layout>

    <Script>
        <![CDATA[
            private function slider_change(evt:Event):void {
                lbl.text = fxTextArea.getStyle('lineHeight');
            }
        ]]>
    </Script>

    <VBox id="box"
            width="100%"
            height="100%"
            paddingLeft="10"
            paddingRight="10"
            paddingTop="10"
            paddingBottom="10">
        <Form styleName="plain">
            <FormItem label="lineHeight:"
                    direction="horizontal">
                <FxHSlider id="slider"
                        minimum="50"
                        maximum="400"
                        value="120"
                        liveDragging="true"
                        change="slider_change(event);" />
                <Label id="lbl" />
            </FormItem>
        </Form>

        <FxTextArea id="fxTextArea"
                lineHeight="{slider.value}%"
                textAlign="justify"
                width="100%"
                height="100%">
            <content><String source="data/lorem.txt" /></content>
        </FxTextArea>
    </VBox>

</FxApplication>

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.

{ 1 comment… read it below or add one }

1 Tangent November 5, 2008 at 1:46 pm

Would be nice to have a sample showing as well.

Reply

Leave a Comment

Sorry, this blog is terrible at eating HTML comments.
If you're pasting any HTML/XML/MXML code, you need to convert your < characters to &lt; and your > characters to &gt; .

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree

Previous post:

Next post: