04
Nov
08

Aligning text vertically within an FxTextInput control in Flex Gumbo

The following example shows how you can align text vertically within a Flex Gumbo FxTextInput control by setting the verticalAlign 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"?>
<!-- http://blog.flexexamples.com/2008/11/04/aligning-text-vertically-within-an-fxtextinput-control-in-flex-gumbo/ -->
<FxApplication name="FxTextInput_verticalAlign_test"
        xmlns="http://ns.adobe.com/mxml/2009">
    <layout>
        <BasicLayout />
    </layout>

    <Declarations>
        <Array id="arr">
            <Object label="top" />
            <Object label="middle" />
            <Object label="bottom" />
            <Object label="justified" />
        </Array>
    </Declarations>

    <Form>
        <FormItem label="verticalAlign:">
            <ComboBox id="comboBox" dataProvider="{arr}" />
        </FormItem>
    </Form>

    <HGroup verticalCenter="0" horizontalCenter="0">
        <FxTextInput height="100" verticalAlign="{comboBox.selectedItem.label}">
            <text>The quick brown fox jumped over the lazy dog. 1234567890</text>
        </FxTextInput>
    </HGroup>

    <Label text="{mx_internal::VERSION}" horizontalCenter="0" bottom="5" />

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


0 Responses to “Aligning text vertically within an FxTextInput control in Flex Gumbo”


  1. No Comments

Leave a Reply

This blog is terrible at eating HTML tags. If you plan on posting code/XML, please escape your "<" characters as "&lt;" and your ">" characters as "&gt;".




Badge Farm

  • Powered by Redoable 1.2
  • Cornify
  • Feeds burnt by Feedburner
  • Feed