用ColorPicker 设置控件颜色

日期:2008-12-19    阅读:183   分类:Flex~Flash

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" cornerRadius="2">
    <mx:Canvas width="370" height="333" horizontalCenter="-25" verticalCenter="-17"
                id="cnv" backgroundColor="#C58B8B"
                backgroundAlpha="0.5">
        <mx:ColorPicker x="93" y="77" width="66" height="51" id="clp" change="setColor(event)"/>
        <mx:Label x="23" y="10" text="ChangeColor&gt;&gt;" fontFamily="Arial" fontWeight="bold"/>
    </mx:Canvas>
    <mx:Script>
        <![CDATA[
            import mx.events.ColorPickerEvent;
            public function setColor(evt:ColorPickerEvent):void
            {
                cnv.setStyle("backgroundColor" ,evt.color);
            }
        ]]>
    </mx:Script>
</mx:Application>

本页链接: http://www.scriptlover.com/static/276-ColorPicker-控件

标签:

相关文章

网友评论

Leave a comment

 required

 required (Not published)

 required