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.

 
About The Author

Peter deHaan

Peter deHaan currently works for Adobe on the Flex SDK QA team. While not working on Flex, Flash, and ColdFusion applications, Peter enjoys making up bios and writing in 3rd person. Peter's rarely updated blog can be found at blogs.adobe.com/pdehaan/, actionscriptexamples.com, airexamples.com, and coldfusionexamples.com.

Comments are closed.