<?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; TextInput</title>
	<atom:link href="http://blog.flexexamples.com/category/halo/textinput/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>Always displaying the selected text in a TextInput in Flex</title>
		<link>http://blog.flexexamples.com/2009/04/30/always-displaying-the-selected-text-in-a-textinput-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/04/30/always-displaying-the-selected-text-in-a-textinput-in-flex/#comments</comments>
		<pubDate>Fri, 01 May 2009 06:59:29 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextInput]]></category>
		<category><![CDATA[alwaysShowSelection]]></category>
		<category><![CDATA[getTextField()]]></category>
		<category><![CDATA[mx internal]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/04/30/always-displaying-the-selected-text-in-a-textinput-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can get the Flex TextInput control to display the currently selected text regardless of whether it has focus by using the mx_internal namespace, the getTextField() method and the Boolean alwaysShowSelection property.</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/04/30/always-displaying-the-selected-text-in-a-textinput-in-flex/ --&#62; &#60;mx:Application name="TextInput_getTextField_alwaysShowSelection_test" [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can get the Flex TextInput control to display the currently selected text regardless of whether it has focus by using the <code>mx_internal</code> namespace, the <code>getTextField()</code> method and the Boolean <code>alwaysShowSelection</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-1064"></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/04/30/always-displaying-the-selected-text-in-a-textinput-in-flex/ --&gt;
&lt;mx:Application name="TextInput_getTextField_alwaysShowSelection_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.core.UITextField;
            import mx.controls.TextInput;

            private function init(evt:Event):void {
                var ti:TextInput = evt.currentTarget as TextInput;
                var tf:UITextField = ti.mx_internal::getTextField();
                tf.alwaysShowSelection = true;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:TextInput id="textInput"
            text="The quick brown fox jumps over the lazy dog."
            selectionBeginIndex="4" selectionEndIndex="9"
            initialize="init(event);" /&gt;
    &lt;mx:Button label="Submit" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_getTextField_alwaysShowSelection_test/bin/srcview/">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/TextInput_getTextField_alwaysShowSelection_test/bin/main.html" width="100%" height="150"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Always displaying the selected text in a TextInput in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/04/30/always-displaying-the-selected-text-in-a-textinput-in-flex/',contentID: 'post-1064',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'alwaysShowSelection,getTextField(),mx internal',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/04/30/always-displaying-the-selected-text-in-a-textinput-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting the horizontal scroll position in the TextInput control in Flex</title>
		<link>http://blog.flexexamples.com/2009/01/27/setting-the-horizontal-scroll-position-in-the-textinput-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2009/01/27/setting-the-horizontal-scroll-position-in-the-textinput-control-in-flex/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 07:56:18 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextInput]]></category>
		<category><![CDATA[horizontalScrollPosition]]></category>
		<category><![CDATA[maxHorizontalScrollPosition]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2009/01/27/setting-the-horizontal-scroll-position-in-the-textinput-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can progammatically scroll the Flex TextInput control by setting the horizontalScrollPosition property.</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/27/setting-the-horizontal-scroll-position-in-the-textinput-control-in-flex/ --&#62; &#60;mx:Application name="TextInput_horizontalScrollPosition_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ private function textInput_change(evt:Event):void { slider.maximum = textInput.maxHorizontalScrollPosition; } ]]&#62; &#60;/mx:Script&#62; &#60;mx:ApplicationControlBar dock="true"&#62; &#60;mx:Form [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can progammatically scroll the Flex TextInput control by setting the <code>horizontalScrollPosition</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-945"></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/27/setting-the-horizontal-scroll-position-in-the-textinput-control-in-flex/ --&gt;
&lt;mx:Application name="TextInput_horizontalScrollPosition_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function textInput_change(evt:Event):void {
                slider.maximum = textInput.maxHorizontalScrollPosition;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="horizontalScrollPosition:"&gt;
                &lt;mx:HSlider id="slider"
                        snapInterval="1"
                        liveDragging="true"
                        showTrackHighlight="true" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextInput id="textInput"
            text="The quick brown fox jumps over the lazy dog."
            horizontalScrollPosition="{slider.value}"
            width="100"
            creationComplete="textInput_change(event);"
            change="textInput_change(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting the horizontal scroll position in the TextInput control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2009/01/27/setting-the-horizontal-scroll-position-in-the-textinput-control-in-flex/',contentID: 'post-945',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'horizontalScrollPosition,maxHorizontalScrollPosition',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/27/setting-the-horizontal-scroll-position-in-the-textinput-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Displaying a border on specific sides of a TextInput control in Flex</title>
		<link>http://blog.flexexamples.com/2008/07/08/displaying-a-border-on-specific-sides-of-a-textinput-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/07/08/displaying-a-border-on-specific-sides-of-a-textinput-control-in-flex/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 04:52:32 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextInput]]></category>
		<category><![CDATA[borderColor]]></category>
		<category><![CDATA[borderSides]]></category>
		<category><![CDATA[borderStyle]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/07/08/displaying-a-border-on-specific-sides-of-a-textinput-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can toggle which sides of a Flex TextInput control display the borderSides and borderStyle styles.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2008/07/08/displaying-a-border-on-specific-sides-of-a-textinput-control-in-flex/ --&#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[ private function setBorderSides():void { var arr:Array = []; if (leftCheckBox.selected) { arr.push("left"); } if (rightCheckBox.selected) [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can toggle which sides of a Flex TextInput control display the <code>borderSides</code> and <code>borderStyle</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-682"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2008/07/08/displaying-a-border-on-specific-sides-of-a-textinput-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[
            private function setBorderSides():void {
                var arr:Array = [];
                if (leftCheckBox.selected) {
                    arr.push("left");
                }
                if (rightCheckBox.selected) {
                    arr.push("right");
                }
                if (topCheckBox.selected) {
                    arr.push("top");
                }
                if (bottomCheckBox.selected) {
                    arr.push("bottom");
                }
                textInput.setStyle("borderSides", arr.join(" "));
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="left:"&gt;
                &lt;mx:CheckBox id="leftCheckBox"
                        selected="true"
                        change="setBorderSides();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="right:"&gt;
                &lt;mx:CheckBox id="rightCheckBox"
                        selected="true"
                        change="setBorderSides();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="top:"&gt;
                &lt;mx:CheckBox id="topCheckBox"
                        selected="true"
                        change="setBorderSides();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="bottom:"&gt;
                &lt;mx:CheckBox id="bottomCheckBox"
                        selected="true"
                        change="setBorderSides();" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextInput id="textInput"
            borderSides="left right"
            borderColor="red"
            borderStyle="solid" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a border on specific sides of a TextInput control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/07/08/displaying-a-border-on-specific-sides-of-a-textinput-control-in-flex/',contentID: 'post-682',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'borderColor,borderSides,borderStyle',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/08/displaying-a-border-on-specific-sides-of-a-textinput-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Detecting a double click on a TextInput control in Flex</title>
		<link>http://blog.flexexamples.com/2008/06/24/detecting-a-double-click-on-a-textinput-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/06/24/detecting-a-double-click-on-a-textinput-control-in-flex/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 06:54:34 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextInput]]></category>
		<category><![CDATA[doubleClick]]></category>
		<category><![CDATA[doubleClickEnabled]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/24/detecting-a-double-click-on-a-textinput-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can detect when a user double clicks a Flex TextInput control using the doubleClick event.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_doubleClick_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/06/24/detecting-a-double-click-on-a-textinput-control-in-flex/ --&#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[ private function textInput_doubleClick(evt:MouseEvent):void { var ti:TextInput = evt.currentTarget as TextInput; ti.enabled [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can detect when a user double clicks a Flex TextInput control using the <code>doubleClick</code> event.</p>
<p>Full code after the jump.</p>
<p><span id="more-683"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_doubleClick_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/06/24/detecting-a-double-click-on-a-textinput-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[
            private function textInput_doubleClick(evt:MouseEvent):void {
                var ti:TextInput = evt.currentTarget as TextInput;
                ti.enabled = !ti.enabled;
                ti.editable = ti.enabled;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:TextInput id="textInput1"
            text="The quick brown fox jumped over the lazy dog"
            doubleClickEnabled="true"
            doubleClick="textInput_doubleClick(event);" /&gt;

    &lt;mx:TextInput id="textInput2"
            text="The quick brown fox jumped over the lazy dog"
            doubleClickEnabled="true"
            doubleClick="textInput_doubleClick(event);" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_doubleClick_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/TextInput_doubleClick_test/bin/main.html" width="100%" height="150"></iframe></p>
<p>Due to popular demand, here is the &#8220;same&#8221; example in a more ActionScript friendly format:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_doubleClick_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/06/24/detecting-a-double-click-on-a-textinput-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        initialize="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.controls.TextInput;

            private var textInput1:TextInput;
            private var textInput2:TextInput;

            private function init():void {
                textInput1 = new TextInput();
                textInput1.text = "The quick brown fox jumped over the lazy dog";
                textInput1.doubleClickEnabled = true;
                textInput1.addEventListener(MouseEvent.DOUBLE_CLICK,
                            textInput_doubleClick);
                addChild(textInput1);

                textInput2 = new TextInput();
                textInput2.text = "The quick brown fox jumped over the lazy dog";
                textInput2.doubleClickEnabled = true;
                textInput2.addEventListener(MouseEvent.DOUBLE_CLICK,
                            textInput_doubleClick);
                addChild(textInput2);
            }

            private function textInput_doubleClick(evt:MouseEvent):void {
                var ti:TextInput = evt.currentTarget as TextInput;
                ti.enabled = !ti.enabled;
                ti.editable = ti.enabled;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Detecting a double click on a TextInput control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/06/24/detecting-a-double-click-on-a-textinput-control-in-flex/',contentID: 'post-683',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'doubleClick,doubleClickEnabled',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/06/24/detecting-a-double-click-on-a-textinput-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Rounding specific corners on a focus rectangle in the TextInput control in Flex</title>
		<link>http://blog.flexexamples.com/2008/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-control-in-flex/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 05:52:52 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextInput]]></category>
		<category><![CDATA[cornerRadius]]></category>
		<category><![CDATA[focusRoundedCorners]]></category>
		<category><![CDATA[focusThickness]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can apply a corner radius to specific corners of a Flex TextInput control&#8217;s focus rectangle by setting the focusRoundedCorners style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_focusRoundedCorners_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/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-control-in-flex/ --&#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[ private function checkBox_change(evt:Event):void { var corners:Array [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can apply a corner radius to specific corners of a Flex TextInput control&#8217;s focus rectangle by setting the <code>focusRoundedCorners</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-667"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_focusRoundedCorners_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/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-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[
            private function checkBox_change(evt:Event):void {
                var corners:Array = [];
                if (tLeft.selected) {
                    corners.push("tl");
                }
                if (tRight.selected) {
                    corners.push("tr");
                }
                if (bLeft.selected) {
                    corners.push("bl");
                }
                if (bRight.selected) {
                    corners.push("br");
                }
                var str:String = corners.join(" ");
                textInput.setStyle("focusRoundedCorners", str);
                focusManager.setFocus(textInput);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="top left (tl):"&gt;
                &lt;mx:CheckBox id="tLeft"
                        selected="true"
                        change="checkBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="top right (tr):"&gt;
                &lt;mx:CheckBox id="tRight"
                        selected="true"
                        change="checkBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="bottom left (bl):"&gt;
                &lt;mx:CheckBox id="bLeft"
                        selected="true"
                        change="checkBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="top right (br):"&gt;
                &lt;mx:CheckBox id="bRight"
                        selected="true"
                        change="checkBox_change(event);" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:TextInput id="textInput"
            focusThickness="10"
            cornerRadius="10" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_focusRoundedCorners_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/TextInput_focusRoundedCorners_test/bin/main.html" width="100%" height="250"></iframe></p>
<p>You can also set the <code>focusRoundedCorners</code> style in MXML, as seen in the following example:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_focusRoundedCorners_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/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-control-in-flex/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:TextInput id="textInput"
            focusThickness="10"
            cornerRadius="10"
            focusRoundedCorners="tl br" /&gt;

&lt;/mx:Application&gt;
</pre>
<p>Or, you can set the <code>focusRoundedCorners</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/TextInput_focusRoundedCorners_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/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-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;
        TextInput {
            focusRoundedCorners: "tl br";
        }
    &lt;/mx:Style&gt;

    &lt;mx:TextInput id="textInput"
            focusThickness="10"
            cornerRadius="10" /&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Rounding specific corners on a focus rectangle in the TextInput control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-control-in-flex/',contentID: 'post-667',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'cornerRadius,focusRoundedCorners,focusThickness',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/06/12/rounding-specific-corners-on-a-focus-rectangle-in-the-textinput-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Restricting which characters a user can type in a TextInput control in Flex</title>
		<link>http://blog.flexexamples.com/2008/05/15/restricting-which-characters-a-user-can-type-in-a-textinput-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/05/15/restricting-which-characters-a-user-can-type-in-a-textinput-control-in-flex/#comments</comments>
		<pubDate>Fri, 16 May 2008 03:52:29 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextInput]]></category>
		<category><![CDATA[restrict]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/05/15/restricting-which-characters-a-user-can-type-in-a-textinput-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can restrict which characters a user can enter into a Flex TextInput control by setting the restrict property.</p> <p>Full code after the jump.</p> <p></p> <p>The following example sets the restrict property to &#8220;0-9\-&#8221;, which only allows numbers and the hyphen (-) character:</p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_restrict_test/bin/srcview/source/main.mxml.html">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can restrict which characters a user can enter into a Flex TextInput control by setting the <code>restrict</code> property.</p>
<p>Full code after the jump.</p>
<p><span id="more-630"></span></p>
<p>The following example sets the <code>restrict</code> property to &#8220;0-9\-&#8221;, which only allows numbers and the hyphen (-) character:</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_restrict_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/05/15/restricting-which-characters-a-user-can-type-in-a-textinput-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[
            private function textInput_change(evt:Event):void {
                arrColl.addItem(evt);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ArrayCollection id="arrColl" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:TextInput id="textInput"
                restrict="0-9\\-"
                change="textInput_change(event);" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:DataGrid id="dataGrid"
            dataProvider="{arrColl}"
            width="100%"
            height="100%" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_restrict_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/TextInput_restrict_test/bin/main.html" width="100%" height="400"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Restricting which characters a user can type in a TextInput control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/05/15/restricting-which-characters-a-user-can-type-in-a-textinput-control-in-flex/',contentID: 'post-630',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'restrict',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/05/15/restricting-which-characters-a-user-can-type-in-a-textinput-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Changing the focus rectangle color on a TextInput control in Flex</title>
		<link>http://blog.flexexamples.com/2008/04/12/changing-the-focus-rectangle-color-on-a-textinput-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/04/12/changing-the-focus-rectangle-color-on-a-textinput-control-in-flex/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 06:07:31 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextInput]]></category>
		<category><![CDATA[themeColor]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/04/12/changing-the-focus-rectangle-color-on-a-textinput-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can change the focus rectangle color for a Flex TextInput control by setting the themeColor style.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_themeColor_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/04/12/changing-the-focus-rectangle-color-on-a-textinput-control-in-flex/ --&#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.DropdownEvent; import mx.events.ColorPickerEvent; private function colorPicker_change(evt:ColorPickerEvent):void { textInput.setStyle("themeColor", evt.color); [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can change the focus rectangle color for a Flex TextInput control by setting the <code>themeColor</code> style.</p>
<p>Full code after the jump.</p>
<p><span id="more-593"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_themeColor_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/04/12/changing-the-focus-rectangle-color-on-a-textinput-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.DropdownEvent;
            import mx.events.ColorPickerEvent;

            private function colorPicker_change(evt:ColorPickerEvent):void {
                textInput.setStyle("themeColor", evt.color);
            }

            private function colorPicker_close(evt:DropdownEvent):void {
                focusManager.setFocus(textInput);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

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

    &lt;mx:TextInput id="textInput" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_themeColor_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/TextInput_themeColor_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Changing the focus rectangle color on a TextInput control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/04/12/changing-the-focus-rectangle-color-on-a-textinput-control-in-flex/',contentID: 'post-593',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: '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/2008/04/12/changing-the-focus-rectangle-color-on-a-textinput-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Preventing line feeds in a TextArea control in Flex</title>
		<link>http://blog.flexexamples.com/2008/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/</link>
		<comments>http://blog.flexexamples.com/2008/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 05:56:07 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextArea]]></category>
		<category><![CDATA[TextEvent]]></category>
		<category><![CDATA[TextInput]]></category>
		<category><![CDATA[preventDefault()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/</guid>
		<description><![CDATA[<p>The following example shows how you can prevent a user from pressing Enter in a Flex TextArea control by listening for the textInput event and checking the TextEvent object&#8217;s text property for a newline character (&#8220;\n&#8221;).</p> <p></p> &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!-- http://blog.flexexamples.com/2008/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/ --&#62; &#60;mx:Application 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:Script&#62; &#60;![CDATA[ private function textArea_textInput(evt:TextEvent):void { [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can prevent a user from pressing Enter in a Flex TextArea control by listening for the <code>textInput</code> event and checking the TextEvent object&#8217;s <code>text</code> property for a newline character (&#8220;\n&#8221;).</p>
<p><span id="more-548"></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/2008/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> 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: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            private function textArea_textInput(evt:TextEvent):void {</span>
<span style="color: #339933;">                if (evt.text == &quot;\\n&quot;) {</span>
<span style="color: #339933;">                    evt.preventDefault();</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextArea</span> id=<span style="color: #ff0000;">&quot;textArea&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;160&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;120&quot;</span></span>
<span style="color: #000000;">            textInput=<span style="color: #ff0000;">&quot;textArea_textInput(event);&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:text</span><span style="color: #7400FF;">&gt;</span></span>The quick brown fox jumped over the lazy dog.<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:text</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:TextArea</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/TextArea_textInput_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/TextArea_textInput_test/bin/main.html" width="100%" height="200"></iframe></p>
<p class="new">Update 8/19/2008: If you want to prevent a user from pasting text with a carriage return/linefeed, you could listen for the <code>change</code> event and use the String class&#8217;s <code>replace()</code> method to replace any newline (&#8220;\n&#8221;) or linefeed (&#8220;\r&#8221;) with an empty string, as seen in the following example:</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/2008/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/ --&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> 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: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">        &lt;![CDATA[</span>
<span style="color: #339933;">            private function textArea_textInput(evt:TextEvent):void {</span>
<span style="color: #339933;">                if (evt.text == &quot;\\n&quot;) {</span>
<span style="color: #339933;">                    evt.preventDefault();</span>
<span style="color: #339933;">                }</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">            private function textArea_change(evt:Event):void {</span>
<span style="color: #339933;">                textArea.text = textArea.text.replace(/\\n|\\r/ig, &quot;&quot;);</span>
<span style="color: #339933;">            }</span>
<span style="color: #339933;">        ]]&gt;</span>
<span style="color: #339933;">    &lt;/mx:Script&gt;</span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextArea</span> id=<span style="color: #ff0000;">&quot;textArea&quot;</span></span>
<span style="color: #000000;">            text=<span style="color: #ff0000;">&quot;The quick brown fox jumped over the lazy dog.&quot;</span></span>
<span style="color: #000000;">            verticalScrollPolicy=<span style="color: #ff0000;">&quot;on&quot;</span></span>
<span style="color: #000000;">            width=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">            height=<span style="color: #ff0000;">&quot;100%&quot;</span></span>
<span style="color: #000000;">            textInput=<span style="color: #ff0000;">&quot;textArea_textInput(event);&quot;</span></span>
<span style="color: #000000;">            change=<span style="color: #ff0000;">&quot;textArea_change(event);&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>

<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Preventing line feeds in a TextArea control in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/',contentID: 'post-548',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'preventDefault()',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/03/07/preventing-line-feeds-in-a-textarea-control-in-flex/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Creating a tool tip on a Flex TextInput control with password masked text</title>
		<link>http://blog.flexexamples.com/2008/01/28/creating-a-tool-tip-on-a-flex-textinput-control-with-password-masked-text/</link>
		<comments>http://blog.flexexamples.com/2008/01/28/creating-a-tool-tip-on-a-flex-textinput-control-with-password-masked-text/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 14:38:23 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[TextInput]]></category>
		<category><![CDATA[ToolTip]]></category>
		<category><![CDATA[displayAsPassword]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/28/creating-a-tool-tip-on-a-flex-textinput-control-with-password-masked-text/</guid>
		<description><![CDATA[<p>The following example shows you how you can use a tool tip on a Flex TextInput control with its displayAsPassword property set to true. By mousing over the credit card number field in the form below, you can see your credit card number in a readable tool tip.</p> <p>Want the short version? Use a simple [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows you how you can use a tool tip on a Flex TextInput control with its <code>displayAsPassword</code> property set to <code>true</code>. By mousing over the credit card number field in the form below, you can see your credit card number in a readable tool tip.</p>
<p>Want the short version? Use a simple binding to bind the tool tip text to the TextInput control&#8217;s text, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:TextInput id=&quot;ccNumber&quot;
        text=&quot;4111111111111111&quot;
        displayAsPassword=&quot;true&quot;
        <strong style="color:red;">toolTip=&quot;{ccNumber.text}&quot;</strong> /&gt;
</pre>
<p>Looking for a longer version? Read on!</p>
<p>Full code after the jump.</p>
<p><span id="more-486"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_toolTip_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/28/creating-a-tool-tip-on-a-flex-textinput-control-with-password-masked-text/ --&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.formatters.DateBase;
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Form&gt;
        &lt;mx:FormItem label="Name:"&gt;
            &lt;mx:TextInput id="ccName"
                    text="JOHN DOE" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="Number:"&gt;
            &lt;mx:TextInput id="ccNumber"
                    text="4111111111111111"
                    displayAsPassword="true"
                    toolTip="{ccNumber.text}" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="Type:"&gt;
            &lt;mx:ComboBox id="ccType"
                    dataProvider="[American Express,MasterCard,Visa]" /&gt;
        &lt;/mx:FormItem&gt;
        &lt;mx:FormItem label="Expiration:" direction="horizontal"&gt;
            &lt;mx:ComboBox id="ccExpMM"
                    initialize="ccExpMM.dataProvider = DateBase.monthNamesShort;" /&gt;
            &lt;mx:ComboBox id="ccExpYYYY"
                    dataProvider="[2008,2009,2010]" /&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/TextInput_toolTip_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/TextInput_toolTip_test/bin/main.html" width="100%" height="250"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Creating a tool tip on a Flex TextInput control with password masked text on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/28/creating-a-tool-tip-on-a-flex-textinput-control-with-password-masked-text/',contentID: 'post-486',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'displayAsPassword',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/28/creating-a-tool-tip-on-a-flex-textinput-control-with-password-masked-text/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Displaying a TextInput control&#8217;s text as a password in Flex (redux)</title>
		<link>http://blog.flexexamples.com/2008/01/27/displaying-a-textinput-controls-text-as-a-password-in-flex-redux/</link>
		<comments>http://blog.flexexamples.com/2008/01/27/displaying-a-textinput-controls-text-as-a-password-in-flex-redux/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 16:42:45 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[PopUpManager]]></category>
		<category><![CDATA[TextInput]]></category>
		<category><![CDATA[displayAsPassword]]></category>
		<category><![CDATA[focusIn]]></category>
		<category><![CDATA[focusOut]]></category>
		<category><![CDATA[removePopUp()]]></category>
		<category><![CDATA[setTimeout()]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2008/01/27/displaying-a-textinput-controls-text-as-a-password-in-flex-redux/</guid>
		<description><![CDATA[<p>We&#8217;ve already seen how to get a TextInput control to display its text as a masked password field before in an earlier example, <a href="http://blog.flexexamples.com/2008/01/05/displaying-a-textinput-controls-text-as-a-password-in-flex/">&#8220;Displaying a TextInput control&#8217;s text as a password in Flex&#8221;</a> by setting the displayAsPassword property to true.<br /> The following example will show you how you can listen for the focusIn [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve already seen how to get a TextInput control to display its text as a masked password field before in an earlier example, <a href="http://blog.flexexamples.com/2008/01/05/displaying-a-textinput-controls-text-as-a-password-in-flex/">&#8220;Displaying a TextInput control&#8217;s text as a password in Flex&#8221;</a> by setting the <code>displayAsPassword</code> property to <code>true</code>.<br />
The following example will show you how you can listen for the <code>focusIn</code> and <code>focusOut</code> events to toggle the <code>displayAsPassword</code> property so that when the password field has focus the text is displayed as plain text, and when the password field does not have focus the text is displayed as masked text.</p>
<p>Full code after the jump.</p>
<p><span id="more-484"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_displayAsText_test_2/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/27/displaying-a-textinput-controls-text-as-a-password-in-flex-redux/ --&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.controls.Alert;
            import mx.managers.PopUpManager;

            private var alert:Alert;

            private function submit_click():void {
                alert = Alert.show("Closing in 3 seconds.",
                                    "Submitting...");
                setTimeout(closeAlert, 3000);
            }

            private function reset_click():void {
                alert = Alert.show("Closing in 1 second.",
                                    "Resetting...");
                username.text = "";
                password.text = "";
                setTimeout(closeAlert, 1000);
            }

            private function closeAlert():void {
                PopUpManager.removePopUp(alert);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Panel title="Login"&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormItem label="Username:" required="true"&gt;
                &lt;mx:TextInput id="username"
                        text="JohnDoe"
                        maxChars="16" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="Password:" required="true"&gt;
                &lt;mx:TextInput id="password"
                        text="p455w0rd"
                        maxChars="16"
                        displayAsPassword="true"
                        focusIn="password.displayAsPassword = false;"
                        focusOut="password.displayAsPassword = true;" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
        &lt;mx:ControlBar horizontalAlign="right"&gt;
            &lt;mx:Button id="submit"
                    label="Submit"
                    click="submit_click();" /&gt;
            &lt;mx:Button id="reset"
                    label="Reset"
                    click="reset_click();" /&gt;
        &lt;/mx:ControlBar&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/TextInput_displayAsText_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/TextInput_displayAsText_test_2/bin/main.html" width="100%" height="220"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Displaying a TextInput control\&#039;s text as a password in Flex (redux) on FlexExamples.com',url: 'http://blog.flexexamples.com/2008/01/27/displaying-a-textinput-controls-text-as-a-password-in-flex-redux/',contentID: 'post-484',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'displayAsPassword,focusIn,focusOut,removePopUp(),setTimeout()',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/27/displaying-a-textinput-controls-text-as-a-password-in-flex-redux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

