<?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; textSelectedColor</title>
	<atom:link href="http://blog.flexexamples.com/tag/textselectedcolor/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>Setting the label color on a CheckBox control in Flex</title>
		<link>http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 07:05:13 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[styleName]]></category>
		<category><![CDATA[textRollOverColor]]></category>
		<category><![CDATA[textSelectedColor]]></category>
		<category><![CDATA[themeColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the text and theme color on a Flex CheckBox control based on whether the control is selected or not.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/ --&#62; &#60;mx:Application name="CheckBox_color_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Style&#62; CheckBox { fontWeight: bold; iconColor: [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the text and theme color on a Flex CheckBox control based on whether the control is selected or not.</p>
<p>Full code after the jump.</p>
<p><span id="more-943"></span></p>
<p class="download"><a href="">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/ --&gt;
&lt;mx:Application name="CheckBox_color_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        CheckBox {
            fontWeight: bold;
            iconColor: green;
        }

        .selectedStyle {
            color: green;
            textRollOverColor: green;
            textSelectedColor: green;
            themeColor: green;
        }

        .unselectedStyle {
            color: red;
            textRollOverColor: red;
            textSelectedColor: red;
            themeColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function checkBox_change(evt:Event):void {
                var tgt:CheckBox = evt.currentTarget as CheckBox;
                if (tgt.selected) {
                    tgt.styleName = "selectedStyle";
                } else {
                    tgt.styleName = "unselectedStyle";
                }
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:CheckBox id="checkBox"
            label="CheckBox"
            selected="false"
            styleName="unselectedStyle"
            change="checkBox_change(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the label color on a CheckBox control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/',contentID: 'post-943',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'styleName,textRollOverColor,textSelectedColor,themeColor',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/2009/01/25/setting-the-label-color-on-a-checkbox-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the label color of a selected item on a List control in Flex</title>
		<link>http://blog.flexexamples.com/2008/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 06:21:46 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[List]]></category>
		<category><![CDATA[textSelectedColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can set the label color for a selected item in a Flex List control by setting the textSelectedColor style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_textSelectedColor_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Array id="arr"&#62; &#60;mx:Object label="One" /&#62; &#60;mx:Object label="Two" /&#62; &#60;mx:Object [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can set the label color for a selected item in a Flex List control by setting the <code>textSelectedColor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-721"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_textSelectedColor_test/bin/srcview/source/main.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="One" /&gt;
        &lt;mx:Object label="Two" /&gt;
        &lt;mx:Object label="Three" /&gt;
        &lt;mx:Object label="Four" /&gt;
        &lt;mx:Object label="Five" /&gt;
        &lt;mx:Object label="Six" /&gt;
        &lt;mx:Object label="Seven" /&gt;
        &lt;mx:Object label="Eight" /&gt;
        &lt;mx:Object label="Nine" /&gt;
        &lt;mx:Object label="Ten" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="textSelectedColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:List id="list"
            dataProvider="{arr}"
            textSelectedColor="{colorPicker.selectedColor}"
            width="100" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/List_textSelectedColor_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/List_textSelectedColor_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>You can also set the <code>textSelectedColor</code> style in an external .CSS file or &lt;mx:Style /&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_textSelectedColor_test/bin/srcview/source/main2.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        List {
            textSelectedColor: red;
        }
    &lt;/mx:Style&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="One" /&gt;
        &lt;mx:Object label="Two" /&gt;
        &lt;mx:Object label="Three" /&gt;
        &lt;mx:Object label="Four" /&gt;
        &lt;mx:Object label="Five" /&gt;
        &lt;mx:Object label="Six" /&gt;
        &lt;mx:Object label="Seven" /&gt;
        &lt;mx:Object label="Eight" /&gt;
        &lt;mx:Object label="Nine" /&gt;
        &lt;mx:Object label="Ten" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:List id="list"
            dataProvider="{arr}"
            width="100" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>textSelectedColor</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/List_textSelectedColor_test/bin/srcview/source/main3.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

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

            private function colorPicker_change(evt:ColorPickerEvent):void {
                list.setStyle("textSelectedColor", evt.color);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="One" /&gt;
        &lt;mx:Object label="Two" /&gt;
        &lt;mx:Object label="Three" /&gt;
        &lt;mx:Object label="Four" /&gt;
        &lt;mx:Object label="Five" /&gt;
        &lt;mx:Object label="Six" /&gt;
        &lt;mx:Object label="Seven" /&gt;
        &lt;mx:Object label="Eight" /&gt;
        &lt;mx:Object label="Nine" /&gt;
        &lt;mx:Object label="Ten" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="textSelectedColor:"&gt;
                &lt;mx:ColorPicker id="colorPicker"
                        change="colorPicker_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:List id="list"
            dataProvider="{arr}"
            width="100" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the label color of a selected item on a List control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/',contentID: 'post-721',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'textSelectedColor',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/07/28/setting-the-label-color-of-a-selected-item-on-a-list-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing a Button control&#8217;s text color</title>
		<link>http://blog.flexexamples.com/2007/08/26/changing-a-button-controls-text-color/</link>
		<comments>http://blog.flexexamples.com/2007/08/26/changing-a-button-controls-text-color/#comments</comments>
		<pubDate>Sun, 26 Aug 2007 15:59:14 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Button]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[disabledColor]]></category>
		<category><![CDATA[textRollOverColor]]></category>
		<category><![CDATA[textSelectedColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/26/changing-a-button-controls-text-color/</guid>
		<description><![CDATA[<p>The following example shows how you can control the Button control&#8217;s text color using the color, disabledColor, textRollOverColor, and textSelectedColor styles.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2007/08/26/changing-a-button-controls-text-color/ --&#62; &#60;mx:Application name=&#34;Button_color_test&#34; xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;vertical&#34; verticalAlign=&#34;middle&#34; backgroundColor=&#34;white&#34;&#62; &#160; &#60;mx:ApplicationControlBar dock=&#34;true&#34;&#62; &#60;mx:Label text=&#34;color:&#34; /&#62; &#60;mx:ColorPicker id=&#34;colorCB&#34; /&#62; &#160; &#60;mx:Spacer width=&#34;33%&#34; /&#62; &#160; &#60;mx:Label text=&#34;textRollOverColor:&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can control the Button control&#8217;s text color using the <code>color</code>, <code>disabledColor</code>, <code>textRollOverColor</code>, and <code>textSelectedColor</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-134"></span></p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- http://blog.flexexamples.com/2007/08/26/changing-a-button-controls-text-color/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> name=<span style="color: #ff0000;">&quot;Button_color_test&quot;</span></span>
<span style="color: #000000;">        xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span>
<span style="color: #000000;">        layout=<span style="color: #ff0000;">&quot;vertical&quot;</span></span>
<span style="color: #000000;">        verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span></span>
<span style="color: #000000;">        backgroundColor=<span style="color: #ff0000;">&quot;white&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ApplicationControlBar</span> dock=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;color:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;colorCB&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Spacer</span> width=<span style="color: #ff0000;">&quot;33%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;textRollOverColor:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;textRollOverColorCB&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Spacer</span> width=<span style="color: #ff0000;">&quot;33%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;textSelectedColor:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;textSelectedColorCB&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Spacer</span> width=<span style="color: #ff0000;">&quot;33%&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> text=<span style="color: #ff0000;">&quot;disabledColor:&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:ColorPicker</span> id=<span style="color: #ff0000;">&quot;disabledColorCB&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:CheckBox</span> id=<span style="color: #ff0000;">&quot;enabledCh&quot;</span> label=<span style="color: #ff0000;">&quot;enabled&quot;</span> selected=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:ApplicationControlBar</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;button&quot;</span></span>
<span style="color: #000000;">            label=<span style="color: #ff0000;">&quot;Label&quot;</span></span>
<span style="color: #000000;">            toggle=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #000000;">            enabled=<span style="color: #ff0000;">&quot;{enabledCh.selected}&quot;</span></span>
<span style="color: #000000;">            color=<span style="color: #ff0000;">&quot;{colorCB.selectedColor}&quot;</span></span>
<span style="color: #000000;">            disabledColor=<span style="color: #ff0000;">&quot;{disabledColorCB.selectedColor}&quot;</span></span>
<span style="color: #000000;">            textRollOverColor=<span style="color: #ff0000;">&quot;{textRollOverColorCB.selectedColor}&quot;</span></span>
<span style="color: #000000;">            textSelectedColor=<span style="color: #ff0000;">&quot;{textSelectedColorCB.selectedColor}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Button_color_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/Button_color_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing a Button control\&#039;s text color on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/26/changing-a-button-controls-text-color/',contentID: 'post-134',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Color,disabledColor,textRollOverColor,textSelectedColor',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/08/26/changing-a-button-controls-text-color/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

