main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <!-- http://blog.flexexamples.com/2007/09/23/creating-drop-shadows-on-the-flex-textarea-control/ -->
- <mx:Applicationxmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:ApplicationControlBardock="true">
- <mx:Form>
- <mx:FormItemlabel="dropShadowEnabled:">
- <mx:CheckBoxid="checkBox" selected="true" />
- </mx:FormItem>
- <mx:FormItemlabel="dropShadowColor:">
- <mx:ColorPickerid="colorPicker" />
- </mx:FormItem>
- <mx:FormItemlabel="shadowDirection:">
- <mx:ComboBoxid="comboBox" selectedIndex="1">
- <mx:dataProvider>
- <mx:Array>
- <mx:Objectlabel="left" />
- <mx:Objectlabel="center" />
- <mx:Objectlabel="right" />
- </mx:Array>
- </mx:dataProvider>
- </mx:ComboBox>
- </mx:FormItem>
- <mx:FormItemlabel="shadowDistance:">
- <mx:HSliderid="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:TextAreaid="textArea"
- dropShadowEnabled="{checkBox.selected}"
- dropShadowColor="{colorPicker.selectedColor}"
- shadowDistance="{slider.value}"
- shadowDirection="{comboBox.selectedItem.label}"
- width="320"
- height="120"/>
- </mx:Application>
本文介绍了一种在Flex中为TextArea控件添加阴影效果的方法。通过使用CheckBox、ColorPicker、ComboBox和Slider等组件来动态调整阴影的开启状态、颜色、方向及距离,实现了丰富的视觉效果。
1326

被折叠的 条评论
为什么被折叠?



