<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; swatchBorderColor</title>
	<atom:link href="http://blog.flexexamples.com/tag/swatchbordercolor/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing the swatch highlight size for a ColorPicker control in Flex 3</title>
		<link>http://blog.flexexamples.com/2007/12/29/changing-the-swatch-highlight-size-for-a-colorpicker-control-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2007/12/29/changing-the-swatch-highlight-size-for-a-colorpicker-control-in-flex-3/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 06:45:12 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[swatchBorderColor]]></category>
		<category><![CDATA[swatchBorderSize]]></category>
		<category><![CDATA[swatchHighlightColor]]></category>
		<category><![CDATA[swatchHighlightSize]]></category>
		<category><![CDATA[swatchPanelStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/29/changing-the-swatch-highlight-size-for-a-colorpicker-control-in-flex-3/</guid>
		<description><![CDATA[<p>The following example shows how you can set the swatch highlight size on a Flex 3 ColorPicker control by setting the swatchHighlightSize style. You can also see how you can set the swatchBorderColor, swatchBorderSize, and swatchHighlightColor styles using CSS.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_swatchHighlightSize_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/12/29/changing-the-swatch-highlight-size-for-a-colorpicker-control-in-flex-3/ --&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the swatch highlight size on a Flex 3 ColorPicker control by setting the <code>swatchHighlightSize</code> style. You can also see how you can set the <code>swatchBorderColor</code>, <code>swatchBorderSize</code>, and <code>swatchHighlightColor</code> styles using CSS.</p>
<p>Full code after the jump.</p>
<p><span id="more-396"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_swatchHighlightSize_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/12/29/changing-the-swatch-highlight-size-for-a-colorpicker-control-in-flex-3/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Style&gt;
        ColorPicker {
            swatchPanelStyleName: myCustomSwatchPanelStyleName;
        }

        .myCustomSwatchPanelStyleName {
            /* border */
            swatchBorderColor: white;
            swatchBorderSize: 1;
            /* highlight */
            swatchHighlightColor: red;
            swatchHighlightSize: 1;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.SliderEvent;

            private var cssObj:CSSStyleDeclaration;

            private function init():void {
                cssObj = StyleManager.getStyleDeclaration(".myCustomSwatchPanelStyleName");
                colorPicker.open();
            }

            private function borderSlider_change(evt:SliderEvent):void {
                cssObj.setStyle("swatchBorderSize", evt.value);
                colorPicker.open();
            }

            private function highlightSlider_change(evt:SliderEvent):void {
                cssObj.setStyle("swatchHighlightSize", evt.value);
                colorPicker.open();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="swatchBorderSize:"&gt;
                &lt;mx:HSlider id="borderSlider"
                        minimum="0"
                        maximum="5"
                        value="1"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="1"
                        change="borderSlider_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="swatchHighlightSize:"&gt;
                &lt;mx:HSlider id="highlightSlider"
                        minimum="0"
                        maximum="5"
                        value="1"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="1"
                        change="highlightSlider_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ColorPicker id="colorPicker" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_swatchHighlightSize_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_swatchHighlightSize_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the swatch highlight size for a ColorPicker control in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/29/changing-the-swatch-highlight-size-for-a-colorpicker-control-in-flex-3/',contentID: 'post-396',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'swatchBorderColor,swatchBorderSize,swatchHighlightColor,swatchHighlightSize,swatchPanelStyleName',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/12/29/changing-the-swatch-highlight-size-for-a-colorpicker-control-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

