23
Sep
07

Creating drop shadows on the Flex TextArea control

The following example shows how you can control the drop shadow on a Flex TextArea control using the dropShadowColor, shadowDirection, and shadowDistance styles.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/09/23/creating-drop-shadows-on-the-flex-textarea-control/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:ApplicationControlBar dock="true">
        <mx:Form>
            <mx:FormItem label="dropShadowEnabled:">
                <mx:CheckBox id="checkBox" selected="true" />
            </mx:FormItem>
            <mx:FormItem label="dropShadowColor:">
                <mx:ColorPicker id="colorPicker" />
            </mx:FormItem>
            <mx:FormItem label="shadowDirection:">
                <mx:ComboBox id="comboBox" selectedIndex="1">
                    <mx:dataProvider>
                        <mx:Array>
                            <mx:Object label="left" />
                            <mx:Object label="center" />
                            <mx:Object label="right" />
                        </mx:Array>
                    </mx:dataProvider>
                </mx:ComboBox>
            </mx:FormItem>
            <mx:FormItem label="shadowDistance:">
                <mx:HSlider id="slider"
                        minimum="-10"
                        maximum="10"
                        value="0"
                        labels="[-10,-5,0,5,10]"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="2" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <mx:TextArea id="textArea"
            dropShadowEnabled="{checkBox.selected}"
            dropShadowColor="{colorPicker.selectedColor}"
            shadowDistance="{slider.value}"
            shadowDirection="{comboBox.selectedItem.label}"
            width="320"
            height="120" />

</mx:Application>

View source is enabled in the following example.


0 Responses to “Creating drop shadows on the Flex TextArea control”


  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;".