代码改变世界

ColorPicker

2014-01-24 16:32  cai-yigo  阅读(218)  评论(0编辑  收藏  举报
<?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/mx"
               minWidth="955" minHeight="600">
    <mx:Panel title="颜色选择器" width="75%" horizontalAlign="center" paddingTop="10">
        <s:Label width="100%" color="blue" text="选择一种背景颜色"/>
        <mx:ColorPicker id="cp" showTextField="true" selectedColor="blue"/>
        <mx:VBox width="100%" height="100%" backgroundColor="{cp.selectedColor}" borderStyle="solid">
        </mx:VBox>
        <s:Label color="blue" text="选择的颜色: 0x{cp.selectedColor.toString(16)}"/>
    </mx:Panel>

</s:Application>