<?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; swatchPanelStyleName</title>
	<atom:link href="http://blog.flexexamples.com/tag/swatchpanelstylename/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 text field width for the ColorPicker control in Flex 3</title>
		<link>http://blog.flexexamples.com/2008/01/01/changing-the-text-field-width-for-the-colorpicker-control-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2008/01/01/changing-the-text-field-width-for-the-colorpicker-control-in-flex-3/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 07:38:04 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[swatchPanelStyleName]]></category>
		<category><![CDATA[textFieldWidth]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/01/changing-the-text-field-width-for-the-colorpicker-control-in-flex-3/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/">&#8220;Changing the preview color width for the ColorPicker control in Flex 3&#8243;</a>, we saw how you can change the preview color width for a ColorPicker control.</p> <p>The following example shows how you can change the text field width in the ColorPicker control&#8217;s drop down swatch panel by setting the swatchPanelStyleName [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/">&#8220;Changing the preview color width for the ColorPicker control in Flex 3&#8243;</a>, we saw how you can change the preview color width for a ColorPicker control.</p>
<p>The following example shows how you can change the text field width in the ColorPicker control&#8217;s drop down swatch panel by setting the <code>swatchPanelStyleName</code> and <code>textFieldWidth</code> styles in Flex 3.</p>
<p>Full code after the jump.</p>
<p><span id="more-408"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_textFieldWidth_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/01/changing-the-text-field-width-for-the-colorpicker-control-in-flex-3/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

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

            private function slider_change(evt:SliderEvent):void {
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myCustomSwatchPanelStyleName");
                cssObj.setStyle("textFieldWidth", evt.value);

                colorPicker.open();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

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

        .myCustomSwatchPanelStyleName {
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="textFieldWidth:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        maximum="172"
                        value="72"
                        snapInterval="1"
                        tickInterval="5"
                        liveDragging="true"
                        dataTipPrecision="0"
                        change="slider_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_textFieldWidth_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_textFieldWidth_test/bin/main.html" width="100%" height="300"></iframe></p>
<p class="construction">If you want to remove the text field completely, you can set the <code>showTextField</code> property to <code>false</code>. For more information, see <a href="http://blog.flexexamples.com/2007/12/31/toggling-the-text-field-in-a-flex-colorpicker-control/">&#8220;Toggling the text field in a Flex ColorPicker control&#8221;</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the text field width for the ColorPicker control in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/01/changing-the-text-field-width-for-the-colorpicker-control-in-flex-3/',contentID: 'post-408',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'swatchPanelStyleName,textFieldWidth',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/2008/01/01/changing-the-text-field-width-for-the-colorpicker-control-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing the preview color width for the ColorPicker control in Flex 3</title>
		<link>http://blog.flexexamples.com/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 06:57:50 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[previewWidth]]></category>
		<category><![CDATA[swatchPanelStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/</guid>
		<description><![CDATA[<p>The following example shows how you can change the preview color width in the ColorPicker control&#8217;s drop down swatch panel by setting the swatchPanelStyleName and previewWidth styles in Flex 3.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_previewWidth_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.events.SliderEvent; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the preview color width in the ColorPicker control&#8217;s drop down swatch panel by setting the <code>swatchPanelStyleName</code> and <code>previewWidth</code> styles in Flex 3.</p>
<p>Full code after the jump.</p>
<p><span id="more-407"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_previewWidth_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

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

            private function slider_change(evt:SliderEvent):void {
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myCustomSwatchPanelStyleName");
                cssObj.setStyle("previewWidth", evt.value);

                colorPicker.open();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

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

        .myCustomSwatchPanelStyleName {
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="previewWidth:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        maximum="145"
                        value="45"
                        snapInterval="1"
                        tickInterval="5"
                        liveDragging="true"
                        dataTipPrecision="0"
                        change="slider_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_previewWidth_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_previewWidth_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>You can also set the previewWidth style directly in an external .CSS file or &lt;mx:Style /&gt; block using something similar to the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    ColorPicker {
        swatchPanelStyleName: myCustomSwatchPanelStyleName;
    }

    .myCustomSwatchPanelStyleName {
        previewWidth: 145;
    }
&lt;/mx:Style&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the preview color width for the ColorPicker control in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/',contentID: 'post-407',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'previewWidth,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/2008/01/01/changing-the-preview-color-width-for-the-colorpicker-control-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing the ColorPicker control&#8217;s nested text field styles in Flex 3</title>
		<link>http://blog.flexexamples.com/2007/12/30/changing-the-colorpicker-controls-nested-text-field-styles-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2007/12/30/changing-the-colorpicker-controls-nested-text-field-styles-in-flex-3/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 16:29:27 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[swatchPanelStyleName]]></category>
		<category><![CDATA[textFieldStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/30/changing-the-colorpicker-controls-nested-text-field-styles-in-flex-3/</guid>
		<description><![CDATA[<p>The following example shows how you can customize the appearance of the ColorPicker control&#8217;s nested text field in Flex 3 by setting the textFieldStyleName style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_textFieldStyleName_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/12/30/changing-the-colorpicker-controls-nested-text-field-styles-in-flex-3/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white" creationComplete="init();"&#62; &#60;mx:Style&#62; .myCustomSwatchPanelStyleName { textFieldStyleName: redBold; } .redBold { [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can customize the appearance of the ColorPicker control&#8217;s nested text field in Flex 3 by setting the <code>textFieldStyleName</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-398"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_textFieldStyleName_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/30/changing-the-colorpicker-controls-nested-text-field-styles-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;
        .myCustomSwatchPanelStyleName {
            textFieldStyleName: redBold;
        }

        .redBold {
            color: red;
            fontFamily: Courier;
            fontWeight: bold;
            letterSpacing: 1;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="editable:"&gt;
                &lt;mx:CheckBox id="checkBox"
                        selected="false" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:Form&gt;
        &lt;mx:FormItem label="default:"&gt;
            &lt;mx:ColorPicker editable="{checkBox.selected}" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="textFieldStyleName:"&gt;
            &lt;mx:ColorPicker id="colorPicker"
                    editable="{checkBox.selected}"
                    swatchPanelStyleName="myCustomSwatchPanelStyleName" /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_textFieldStyleName_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_textFieldStyleName_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the ColorPicker control\&#039;s nested text field styles in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/30/changing-the-colorpicker-controls-nested-text-field-styles-in-flex-3/',contentID: 'post-398',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'swatchPanelStyleName,textFieldStyleName',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/30/changing-the-colorpicker-controls-nested-text-field-styles-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Changing the swatch grid background color for a ColorPicker control in Flex 3</title>
		<link>http://blog.flexexamples.com/2007/12/29/changing-the-swatch-grid-background-color-for-a-colorpicker-control-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2007/12/29/changing-the-swatch-grid-background-color-for-a-colorpicker-control-in-flex-3/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 07:14:14 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[horizontalGap]]></category>
		<category><![CDATA[swatchGridBackgroundColor]]></category>
		<category><![CDATA[swatchPanelStyleName]]></category>
		<category><![CDATA[verticalGap]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/29/changing-the-swatch-grid-background-color-for-a-colorpicker-control-in-flex-3/</guid>
		<description><![CDATA[<p>The following example shows how you can set the swatch grid background color on a Flex 3 ColorPicker control by setting the swatchGridBackgroundColor style. You can also see how you can set the horizontalGap, and verticalGap 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_swatchGridBackgroundColor_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-grid-background-color-for-a-colorpicker-control-in-flex-3/ --&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the swatch grid background color on a Flex 3 ColorPicker control by setting the <code>swatchGridBackgroundColor</code> style. You can also see how you can set the <code>horizontalGap</code>, and <code>verticalGap</code> styles using CSS.</p>
<p>Full code after the jump.</p>
<p><span id="more-397"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_swatchGridBackgroundColor_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-grid-background-color-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;
        .myCustomSwatchPanelStyleName {
            /* border */
            swatchBorderColor: white;
            swatchBorderSize: 1;

            /* highlight */
            swatchHighlightColor: black;
            swatchHighlightSize: 2;

            /* gap */
            horizontalGap: 2;
            verticalGap: 2;

            /* background */
            swatchGridBackgroundColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Form&gt;
        &lt;mx:FormItem label="default:"&gt;
            &lt;mx:ColorPicker /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="horizontalGap/verticalGap = 2:"&gt;
            &lt;mx:ColorPicker id="colorPicker"
                    swatchPanelStyleName="myCustomSwatchPanelStyleName" /&gt;
        &lt;/mx:FormItem&gt;
    &lt;/mx:Form&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_swatchGridBackgroundColor_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_swatchGridBackgroundColor_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the swatch grid background color for a ColorPicker control in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/29/changing-the-swatch-grid-background-color-for-a-colorpicker-control-in-flex-3/',contentID: 'post-397',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'horizontalGap,swatchGridBackgroundColor,swatchPanelStyleName,verticalGap',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-grid-background-color-for-a-colorpicker-control-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
		<item>
		<title>Changing the swatch border size for a ColorPicker control in Flex 3</title>
		<link>http://blog.flexexamples.com/2007/12/29/changing-the-swatch-border-size-for-a-colorpicker-control-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2007/12/29/changing-the-swatch-border-size-for-a-colorpicker-control-in-flex-3/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 06:09:09 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[swatchBorderSize]]></category>
		<category><![CDATA[swatchPanelStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/29/changing-the-swatch-border-size-for-a-colorpicker-control-in-flex-3/</guid>
		<description><![CDATA[<p>The following example shows how you can set the swatch border size on a Flex 3 ColorPicker control by setting the swatchBorderSize style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_swatchBorderSize_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-border-size-for-a-colorpicker-control-in-flex-3/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:Style&#62; ColorPicker { swatchPanelStyleName: myCustomSwatchPanelStyleName; } .myCustomSwatchPanelStyleName { swatchBorderSize: 1; } [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the swatch border size on a Flex 3 ColorPicker control by setting the <code>swatchBorderSize</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-395"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_swatchBorderSize_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-border-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"&gt;

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

        .myCustomSwatchPanelStyleName {
            swatchBorderSize: 1;
        }
    &lt;/mx:Style&gt;

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

            private function slider_change(evt:SliderEvent):void {
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myCustomSwatchPanelStyleName");
                cssObj.setStyle("swatchBorderSize", 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="slider"
                        minimum="0"
                        maximum="5"
                        value="1"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="1"
                        change="slider_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_swatchBorderSize_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_swatchBorderSize_test/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the swatch border size for a ColorPicker control in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/29/changing-the-swatch-border-size-for-a-colorpicker-control-in-flex-3/',contentID: 'post-395',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'swatchBorderSize,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-border-size-for-a-colorpicker-control-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing the Flex ColorPicker control&#8217;s swatch panel background color</title>
		<link>http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/</link>
		<comments>http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 18:45:29 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[backgroundColor]]></category>
		<category><![CDATA[highlightColor]]></category>
		<category><![CDATA[swatchPanelStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/</guid>
		<description><![CDATA[<p>The following example shows you how you can change the ColorPicker control&#8217;s background color in Flex 3 by setting the backgroundColor style using CSS and ActionScript.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_backgroundColor_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top" backgroundColor="white"&#62; &#60;mx:Style&#62; .myColorPicker { swatchPanelStyleName: myCustomSwatchPanelStyleName; } .myCustomSwatchPanelStyleName { [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can change the ColorPicker control&#8217;s background color in Flex 3 by setting the <code>backgroundColor</code> style using CSS and ActionScript.</p>
<p>Full code after the jump.</p>
<p><span id="more-394"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_backgroundColor_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/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        .myColorPicker {
            swatchPanelStyleName: myCustomSwatchPanelStyleName;
        }

        .myCustomSwatchPanelStyleName {
            backgroundColor: haloBlue;
        }
    &lt;/mx:Style&gt;

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

            private function backgroundColor_change(evt:ColorPickerEvent):void {
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".myCustomSwatchPanelStyleName");
                cssObj.setStyle("backgroundColor", evt.color);

                colorPicker.open();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="backgroundColor:"&gt;
                &lt;mx:ColorPicker change="backgroundColor_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ColorPicker id="colorPicker"
            styleName="myColorPicker"
            editable="false" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_backgroundColor_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_backgroundColor_test/bin/main.html" width="100%" height="300"></iframe></p>
<p>As you can see, the background color uses a gradient from the specified color to a medium gray color (0xC4CCCC). If you want to have a solid colored swatch panel background that doesn&#8217;t use a gradient, you can set the <code>highlightColor</code> style to the same value as the <code>backgroundColor</code> style, as shown in the following example (new code in red):</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_backgroundColor_test_2/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!-- http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/ --&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        layout=&quot;vertical&quot;
        verticalAlign=&quot;top&quot;
        backgroundColor=&quot;white&quot;&gt;

    &lt;mx:Style&gt;
        .myColorPicker {
            swatchPanelStyleName: myCustomSwatchPanelStyleName;
        }

        .myCustomSwatchPanelStyleName {
            backgroundColor: haloBlue;
            <strong style="color:red;">highlightColor: haloBlue;</strong>
        }
    &lt;/mx:Style&gt;

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

            private function backgroundColor_change(evt:ColorPickerEvent):void {
                var cssObj:CSSStyleDeclaration = StyleManager.getStyleDeclaration(&quot;.myCustomSwatchPanelStyleName&quot;);
                cssObj.setStyle(&quot;backgroundColor&quot;, evt.color);
                <strong style="color:red;">cssObj.setStyle(&quot;highlightColor&quot;, evt.color);</strong>

                colorPicker.open();
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock=&quot;true&quot;&gt;
        &lt;mx:Form styleName=&quot;plain&quot;&gt;
            &lt;mx:FormItem label=&quot;backgroundColor:&quot;&gt;
                &lt;mx:ColorPicker change=&quot;backgroundColor_change(event);&quot; /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ColorPicker id=&quot;colorPicker&quot;
            styleName=&quot;myColorPicker&quot;
            editable=&quot;false&quot; /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_backgroundColor_test_2/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_backgroundColor_test_2/bin/main.html" width="100%" height="300"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the Flex ColorPicker control\&#039;s swatch panel background color on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/12/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/',contentID: 'post-394',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'backgroundColor,highlightColor,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/27/changing-the-flex-colorpicker-controls-swatch-panel-background-color/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling the ColorPicker control in Flex 3</title>
		<link>http://blog.flexexamples.com/2007/10/12/styling-the-colorpicker-control-in-flex-3/</link>
		<comments>http://blog.flexexamples.com/2007/10/12/styling-the-colorpicker-control-in-flex-3/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 19:00:20 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[ColorPicker]]></category>
		<category><![CDATA[swatchPanelStyleName]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/12/styling-the-colorpicker-control-in-flex-3/</guid>
		<description><![CDATA[<p>I saw this come up on a list recently, so thought I&#8217;d share the answer with my loyal readership. Styling the ColorPicker control changed somewhat between Flex 2.0.1 and Flex 3. Now, instead of applying certain styles directly to the ColorPicker itself, you create a new custom style and assign the swatchPanelStyleName style on the [...]]]></description>
			<content:encoded><![CDATA[<p>I saw this come up on a list recently, so thought I&#8217;d share the answer with my loyal readership. Styling the ColorPicker control changed somewhat between Flex 2.0.1 and Flex 3. Now, instead of applying certain styles directly to the ColorPicker itself, you create a new custom style and assign the <code>swatchPanelStyleName</code> style on the ColorPicker. But enough of my rambling, code is worth 1000 words.</p>
<p>Full code after the jump.</p>
<p><span id="more-232"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_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/10/12/styling-the-colorpicker-control-in-flex-3/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="top"
        horizontalAlign="left"
        backgroundColor="white"&gt;

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

        .mySwatchPanel {
            backgroundColor: haloSilver;
            columnCount: 40;
            horizontalGap: 1;
            verticalGap: 1;
            previewHeight: 50;
            previewWidth: 200;
            swatchHeight: 8;
            swatchWidth: 12;
        }
    &lt;/mx:Style&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:ColorPicker /&gt;
    &lt;/mx:ApplicationControlBar&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColorPicker_swatchPanelStyleName_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_test/bin/main.html" width="100%" height="200"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Styling the ColorPicker control in Flex 3 on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/10/12/styling-the-colorpicker-control-in-flex-3/',contentID: 'post-232',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '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/10/12/styling-the-colorpicker-control-in-flex-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

