<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Customizing a Flex TextInput control&#8217;s error color</title>
	<link>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Wed, 08 Oct 2008 06:58:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-15876</link>
		<author>peterd</author>
		<pubDate>Sat, 27 Sep 2008 00:25:50 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-15876</guid>
		<description>Yon,

Something like this?
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&#62;

    &#60;mx:Script&#62;
        &#60;![CDATA[
            import mx.events.ListEvent;

            private function comboBox_change(evt:ListEvent):void {
                var value:String = comboBox.selectedItem.data;
                var cssObj:CSSStyleDeclaration;
                cssObj = StyleManager.getStyleDeclaration(".errorTip");
                cssObj.setStyle("borderColor", value);
                textInput.setStyle("errorColor", value);
            }
        ]]&#62;
    &#60;/mx:Script&#62;

    &#60;mx:Array id="arr"&#62;
        &#60;mx:Object label="Red"    data="red" /&#62;
        &#60;mx:Object label="Orange" data="haloOrange" /&#62;
        &#60;mx:Object label="Yellow" data="yellow" /&#62;
        &#60;mx:Object label="Green"  data="haloGreen" /&#62;
        &#60;mx:Object label="Blue"   data="haloBlue" /&#62;
    &#60;/mx:Array&#62;

    &#60;mx:ApplicationControlBar dock="true"&#62;
        &#60;mx:Form styleName="plain"&#62;
            &#60;mx:FormItem label="color:"&#62;
                &#60;mx:ComboBox id="comboBox"
                        dataProvider="{arr}"
                        prompt="Please select a color:"
                        change="comboBox_change(event);" /&#62;
            &#60;/mx:FormItem&#62;
        &#60;/mx:Form&#62;
    &#60;/mx:ApplicationControlBar&#62;

    &#60;mx:TextInput id="textInput"
            errorString="Oh Noes, an errata!" /&#62;
    
&#60;/mx:Application&#62;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Yon,</p>
<p>Something like this?</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&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.ListEvent;

            private function comboBox_change(evt:ListEvent):void {
                var value:String = comboBox.selectedItem.data;
                var cssObj:CSSStyleDeclaration;
                cssObj = StyleManager.getStyleDeclaration(".errorTip");
                cssObj.setStyle("borderColor", value);
                textInput.setStyle("errorColor", value);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="arr"&gt;
        &lt;mx:Object label="Red"    data="red" /&gt;
        &lt;mx:Object label="Orange" data="haloOrange" /&gt;
        &lt;mx:Object label="Yellow" data="yellow" /&gt;
        &lt;mx:Object label="Green"  data="haloGreen" /&gt;
        &lt;mx:Object label="Blue"   data="haloBlue" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="color:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        dataProvider="{arr}"
                        prompt="Please select a color:"
                        change="comboBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextInput id="textInput"
            errorString="Oh Noes, an errata!" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yon</title>
		<link>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-15874</link>
		<author>Yon</author>
		<pubDate>Sat, 27 Sep 2008 00:15:27 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-15874</guid>
		<description>Hi, i was wondering, how would you change dynamically the &lt;code&gt;errorTip&lt;/code&gt; color?

I want to set warnings and errors.
Warnings being yellow &#38; errors red.

Ive been trying to set
&lt;pre class="code"&gt;
errorTip {
    borderColor: #FF0000;
}
&lt;/pre&gt;

and then programatically change it to say
&lt;pre class="code"&gt;
warnTip {
    borderColor #FFCC00;
}
&lt;/pre&gt;

But i dont know what to set it to.
I was changing the whole TextInput style, so it would also change the &lt;code&gt;errorColor&lt;/code&gt; respectively, and that works fine.

Yet i dont know how to change the &lt;code&gt;errorTip&lt;/code&gt;, since i dont know to what element to apply the &lt;code&gt;.styleName&lt;/code&gt; to

and applying it to the input as
&lt;pre class="code"&gt;
setStyle("errorTip.borderColor", "#FFCC00")
&lt;/pre&gt;

or
&lt;pre class="code"&gt;
setStyle("errorTip", "#FFCC00")
&lt;/pre&gt;

dont seem to work either.

Any clues?</description>
		<content:encoded><![CDATA[<p>Hi, i was wondering, how would you change dynamically the <code>errorTip</code> color?</p>
<p>I want to set warnings and errors.<br />
Warnings being yellow &amp; errors red.</p>
<p>Ive been trying to set</p>
<pre class="code">
errorTip {
    borderColor: #FF0000;
}
</pre>
<p>and then programatically change it to say</p>
<pre class="code">
warnTip {
    borderColor #FFCC00;
}
</pre>
<p>But i dont know what to set it to.<br />
I was changing the whole TextInput style, so it would also change the <code>errorColor</code> respectively, and that works fine.</p>
<p>Yet i dont know how to change the <code>errorTip</code>, since i dont know to what element to apply the <code>.styleName</code> to</p>
<p>and applying it to the input as</p>
<pre class="code">
setStyle("errorTip.borderColor", "#FFCC00")
</pre>
<p>or</p>
<pre class="code">
setStyle("errorTip", "#FFCC00")
</pre>
<p>dont seem to work either.</p>
<p>Any clues?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yon</title>
		<link>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-15873</link>
		<author>Yon</author>
		<pubDate>Sat, 27 Sep 2008 00:10:13 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-15873</guid>
		<description>And how would you change dynamically the &lt;code&gt;errorTip&lt;/code&gt; color?

I want to set warnings and errors.
Warnings being yellow &#38; errors red.

Ive been trying to set 
&lt;pre class="code"&gt;
errorTip {
    borderColor: haloOrange;
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>And how would you change dynamically the <code>errorTip</code> color?</p>
<p>I want to set warnings and errors.<br />
Warnings being yellow &amp; errors red.</p>
<p>Ive been trying to set </p>
<pre class="code">
errorTip {
    borderColor: haloOrange;
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: jaume</title>
		<link>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-14720</link>
		<author>jaume</author>
		<pubDate>Fri, 15 Aug 2008 09:23:33 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-14720</guid>
		<description>Hi, i was looking for this trick for a long time. I had trobule because this style is not on the standard list. Thanks for posting Peter!!


By the way, this site is the best for learning those flex tricks that you're allways wondering about how are done jeje.

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi, i was looking for this trick for a long time. I had trobule because this style is not on the standard list. Thanks for posting Peter!!</p>
<p>By the way, this site is the best for learning those flex tricks that you&#8217;re allways wondering about how are done jeje.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-12851</link>
		<author>peterd</author>
		<pubDate>Thu, 22 May 2008 00:52:19 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-12851</guid>
		<description>Anonymous (if that is you &lt;i&gt;real&lt;/i&gt; name),

What if you try setting the &lt;code&gt;.errorTip&lt;/code&gt; style, like so:
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&#62;

    &#60;mx:Style&#62;
        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }

        .errorTip {
            borderColor: haloOrange;
            color: black;
            fontFamily: Base02Embedded;
            fontSize: 16;
            fontWeight: normal;
        }

        TextInput {
            errorColor: haloOrange;
        }
    &#60;/mx:Style&#62;

    &#60;mx:TextInput id="textInput"
            errorString="Hey, you missed a spot!" /&#62;

&#60;/mx:Application&#62;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Anonymous (if that is you <i>real</i> name),</p>
<p>What if you try setting the <code>.errorTip</code> style, like so:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Style&gt;
        @font-face {
            src: local("Base 02");
            fontFamily: Base02Embedded;
        }

        .errorTip {
            borderColor: haloOrange;
            color: black;
            fontFamily: Base02Embedded;
            fontSize: 16;
            fontWeight: normal;
        }

        TextInput {
            errorColor: haloOrange;
        }
    &lt;/mx:Style&gt;

    &lt;mx:TextInput id="textInput"
            errorString="Hey, you missed a spot!" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-12850</link>
		<author>Anonymous</author>
		<pubDate>Wed, 21 May 2008 22:20:59 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/#comment-12850</guid>
		<description>How do I change the background color around the custom color error message?</description>
		<content:encoded><![CDATA[<p>How do I change the background color around the custom color error message?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
