colorPicker控件的应用

来源:互联网 发布:let it go let it be 编辑:程序博客网 时间:2024/06/17 09:58
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/mxmx" width="336" height="280"  backgroundColor="#ECFDCE" xmlns:mx2="library://ns.adobe.com/flex/mx">
  <fx:Script>
    <![CDATA[
      import mx.events.ColorPickerEvent;
      protected function colorPicker_changeHandler(
        event:ColorPickerEvent):void
      {
        this.setStyle("backgroundColor", event.target.selectedColor);
      }
    ]]>
  </fx:Script>
  <s:Panel title="ColorPicker控件实例"
       horizontalCenter="0" top="20" width="300">
    <s:layout>
      <s:HorizontalLayout paddingTop="20" paddingRight="10"
                paddingLeft="20" paddingBottom="10"/>
    </s:layout>
    <s:Label text="请选择背景颜色:"/>
    <mx2:ColorPicker id="colorPicker" selectedColor="#EEEEEE"
            change="colorPicker_changeHandler(event)"/>
  </s:Panel>
</s:Application>
原创粉丝点击