<?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; selectionVisibility</title>
	<atom:link href="http://blog.flexexamples.com/tag/selectionvisibility/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 inactive text selection color on a FxTextArea control in Flex Gumbo</title>
		<link>http://blog.flexexamples.com/2008/11/15/setting-the-inactive-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/</link>
		<comments>http://blog.flexexamples.com/2008/11/15/setting-the-inactive-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 06:09:37 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[beta]]></category>
		<category><![CDATA[FxTextArea]]></category>
		<category><![CDATA[Gumbo]]></category>
		<category><![CDATA[inactiveSelectionColor]]></category>
		<category><![CDATA[selectionVisibility]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/11/15/setting-the-inactive-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/</guid>
		<description><![CDATA[<p>In previous examples, <a href="http://blog.flexexamples.com/2008/11/13/setting-the-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/">&#8220;Setting the text selection color on a FxTextArea control in Flex Gumbo&#8221;</a> and <a href="http://blog.flexexamples.com/2008/11/14/setting-the-unfocused-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/">&#8220;Setting the unfocused text selection color on a FxTextArea control in Flex Gumbo&#8221;</a>, we saw how to to set the text selection color when the FxTextArea is focused and unfocused by setting the selectionColor and unfocusedSelectionColor styles [...]]]></description>
			<content:encoded><![CDATA[<p>In previous examples, <a href="http://blog.flexexamples.com/2008/11/13/setting-the-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/">&#8220;Setting the text selection color on a FxTextArea control in Flex Gumbo&#8221;</a> and <a href="http://blog.flexexamples.com/2008/11/14/setting-the-unfocused-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/">&#8220;Setting the unfocused text selection color on a FxTextArea control in Flex Gumbo&#8221;</a>, we saw how to to set the text selection color when the FxTextArea is focused and unfocused by setting the <code>selectionColor</code> and <code>unfocusedSelectionColor</code> styles respectively.</p>
<p>The following example shows how you can set the inactive text selection color on a Flex Gumbo FxTextArea control by setting the <code>inactiveSelectionColor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-865"></span></p>
<p class="alert">To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/">&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</a>.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxTextArea_inactiveSelectionColor_test/bin/srcview/source/main_4112.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/15/setting-the-inactive-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxTextArea_inactiveSelectionColor_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;ApplicationControlBar dock="true"&gt;
        &lt;Form styleName="plain"&gt;
            &lt;FormItem label="inactiveSelectionColor:"&gt;
                &lt;ColorPicker id="colorPicker"
                        selectedColor="#FFFF99" /&gt;
            &lt;/FormItem&gt;
        &lt;/Form&gt;
    &lt;/ApplicationControlBar&gt;

    &lt;FxTextArea id="textArea"
            inactiveSelectionColor="{colorPicker.selectedColor}"
            selectionVisibility="always"&gt;
        &lt;content&gt;&lt;String source="data/lorem.txt" /&gt;&lt;/content&gt;
    &lt;/FxTextArea&gt;

    &lt;FxTextInput text="Click here to remove FxTextArea focus"
            widthInChars="32" /&gt;

&lt;/Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/FxTextArea_inactiveSelectionColor_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/FxTextArea_inactiveSelectionColor_test/bin/main_4112.html" width="100%" height="250"></iframe></p>
<p>You can also set the <code>inactiveSelectionColor</code> style in an external .CSS file or &lt;Style&gt; block, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxTextArea_inactiveSelectionColor_test/bin/srcview/source/main2_4112.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/15/setting-the-inactive-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxTextArea_inactiveSelectionColor_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Style&gt;
        FxTextArea {
            inactiveSelectionColor: haloOrange;
        }
    &lt;/Style&gt;

    &lt;FxTextArea id="textArea"
            selectionVisibility="always"&gt;
        &lt;content&gt;&lt;String source="data/lorem.txt" /&gt;&lt;/content&gt;
    &lt;/FxTextArea&gt;

    &lt;FxTextInput text="Click here to remove FxTextArea focus"
            widthInChars="32" /&gt;

&lt;/Application&gt;
</pre>
<p>Or, you can set the <code>inactiveSelectionColor</code> style using ActionScript, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/FxTextArea_inactiveSelectionColor_test/bin/srcview/source/main3_4112.mxml.html">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/11/15/setting-the-inactive-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/ --&gt;
&lt;Application name="FxTextArea_inactiveSelectionColor_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;Script&gt;
        import mx.events.ColorPickerEvent;

        private function colorPicker_change(evt:ColorPickerEvent):void {
            textArea.setStyle("inactiveSelectionColor", evt.color);
        }
    &lt;/Script&gt;

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

    &lt;FxTextArea id="textArea"
            selectionVisibility="always"&gt;
        &lt;content&gt;&lt;String source="data/lorem.txt" /&gt;&lt;/content&gt;
    &lt;/FxTextArea&gt;

    &lt;FxTextInput text="Click here to remove FxTextArea focus"
            widthInChars="32" /&gt;

&lt;/Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the inactive text selection color on a FxTextArea control in Flex Gumbo on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/11/15/setting-the-inactive-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/',contentID: 'post-865',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'Gumbo,inactiveSelectionColor,selectionVisibility',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/11/15/setting-the-inactive-text-selection-color-on-a-fxtextarea-control-in-flex-gumbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

