<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: using setFocus() method to bring focus to a Textinput control.</title>
	<atom:link href="http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/</link>
	<description></description>
	<lastBuildDate>Wed, 06 Jan 2010 13:32:32 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: kumargandhi</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-791</link>
		<dc:creator>kumargandhi</dc:creator>
		<pubDate>Wed, 23 Dec 2009 06:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-791</guid>
		<description>Hi Krishna,
Its on the post itself,after the Updated:: line with red text is the Update to the Post.
regards,
kumar.</description>
		<content:encoded><![CDATA[<p>Hi Krishna,<br />
Its on the post itself,after the Updated:: line with red text is the Update to the Post.<br />
regards,<br />
kumar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-790</link>
		<dc:creator>Krishna</dc:creator>
		<pubDate>Tue, 22 Dec 2009 19:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-790</guid>
		<description>Kumar,
I guess the updated code isn&#039;t there on the post</description>
		<content:encoded><![CDATA[<p>Kumar,<br />
I guess the updated code isn&#8217;t there on the post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-789</link>
		<dc:creator>Krishna</dc:creator>
		<pubDate>Tue, 22 Dec 2009 19:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-789</guid>
		<description>Kumar,
Where is the updated code that you have put.</description>
		<content:encoded><![CDATA[<p>Kumar,<br />
Where is the updated code that you have put.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumargandhi</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-784</link>
		<dc:creator>kumargandhi</dc:creator>
		<pubDate>Fri, 11 Dec 2009 08:05:06 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-784</guid>
		<description>I have just updated the post, and its completely resolved and working fine, comment me for queries.

regards,
kumar.</description>
		<content:encoded><![CDATA[<p>I have just updated the post, and its completely resolved and working fine, comment me for queries.</p>
<p>regards,<br />
kumar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tong Wang</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-783</link>
		<dc:creator>Tong Wang</dc:creator>
		<pubDate>Fri, 11 Dec 2009 06:52:32 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-783</guid>
		<description>This does not work: it only highlights around the textbox, but you can&#039;t type in it as it doesn&#039;t have a cursor in it.

Adding that stage.focus trick made things worse: text box is not even highlighted!</description>
		<content:encoded><![CDATA[<p>This does not work: it only highlights around the textbox, but you can&#8217;t type in it as it doesn&#8217;t have a cursor in it.</p>
<p>Adding that stage.focus trick made things worse: text box is not even highlighted!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-647</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Tue, 30 Jun 2009 08:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-647</guid>
		<description>sorry my code doesn&#039;t look very neat, should still be readable</description>
		<content:encoded><![CDATA[<p>sorry my code doesn&#8217;t look very neat, should still be readable</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-646</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Tue, 30 Jun 2009 08:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-646</guid>
		<description>Howzit all
I came across this error as well
after some searching found out that it is logged
as a bug in Adobe but they have a work around:
http://bugs.adobe.com/jira/browse/SDK-15319
use the callLater() function
with some tweaking i got this method to work for me

I use it on a textInput field&#039;s focusOut, if it fails a RegExp test, i set some vars, and on a focusIn method checks if the previous field failed, then the method sets focus back to the previous textInput as well as show an errorString. I made the focusIn and focusOut methods dynamic, so i use it over on all my required fields

hopefully this helps

here&#039;s my code example:

//mValidation is a Boolean
//lPreviousItem is a String

private function checkFocusInAmount(field:Event)
                                           :void {
   if(!mValidationError) {
     var lText:String = field.currentTarget.text;
     if(Number(lText) == 0) {
	field.currentTarget.text = &quot;&quot;;
     }
   }
   else {
      callLater(
        field.currentTarget.focusManager.setFocus
        [this[mPreviousItem]]);
      }
   }
            
private function checkFocusOutAmount(field:Event)
                                              :void {
   var lText:String = field.currentTarget.text;
   var lTest:RegExp = /^[0-9]+([\.][0-9]{1,2})?$/;
            	
   if(lText == &quot;&quot;) {
      field.currentTarget.text = &quot;0.00&quot;;
   }
   else {
      if(lTest.test(lText)) {
          field.currentTarget.text =
                       Number(lText).toFixed(2);
          field.currentTarget.errorString = &#039;&#039;;
          mValidationError = false;
      }
      else {
        field.currentTarget.errorString = 
          &#039;Amount is in the incorrect format.
          \nOnly an Amount with up to 2 decimal
          places allowed.\nAmount format: #.##&#039;;
        
        mValidationError = true;
        mPreviousItem = field.currentTarget.id;
      }
   }
}</description>
		<content:encoded><![CDATA[<p>Howzit all<br />
I came across this error as well<br />
after some searching found out that it is logged<br />
as a bug in Adobe but they have a work around:<br />
<a href="http://bugs.adobe.com/jira/browse/SDK-15319" rel="nofollow">http://bugs.adobe.com/jira/browse/SDK-15319</a><br />
use the callLater() function<br />
with some tweaking i got this method to work for me</p>
<p>I use it on a textInput field&#8217;s focusOut, if it fails a RegExp test, i set some vars, and on a focusIn method checks if the previous field failed, then the method sets focus back to the previous textInput as well as show an errorString. I made the focusIn and focusOut methods dynamic, so i use it over on all my required fields</p>
<p>hopefully this helps</p>
<p>here&#8217;s my code example:</p>
<p>//mValidation is a Boolean<br />
//lPreviousItem is a String</p>
<p>private function checkFocusInAmount(field:Event)<br />
                                           :void {<br />
   if(!mValidationError) {<br />
     var lText:String = field.currentTarget.text;<br />
     if(Number(lText) == 0) {<br />
	field.currentTarget.text = &#8220;&#8221;;<br />
     }<br />
   }<br />
   else {<br />
      callLater(<br />
        field.currentTarget.focusManager.setFocus<br />
        [this[mPreviousItem]]);<br />
      }<br />
   }</p>
<p>private function checkFocusOutAmount(field:Event)<br />
                                              :void {<br />
   var lText:String = field.currentTarget.text;<br />
   var lTest:RegExp = /^[0-9]+([\.][0-9]{1,2})?$/;</p>
<p>   if(lText == &#8220;&#8221;) {<br />
      field.currentTarget.text = &#8220;0.00&#8243;;<br />
   }<br />
   else {<br />
      if(lTest.test(lText)) {<br />
          field.currentTarget.text =<br />
                       Number(lText).toFixed(2);<br />
          field.currentTarget.errorString = &#8221;;<br />
          mValidationError = false;<br />
      }<br />
      else {<br />
        field.currentTarget.errorString =<br />
          &#8216;Amount is in the incorrect format.<br />
          \nOnly an Amount with up to 2 decimal<br />
          places allowed.\nAmount format: #.##&#8217;;</p>
<p>        mValidationError = true;<br />
        mPreviousItem = field.currentTarget.id;<br />
      }<br />
   }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aruna</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-639</link>
		<dc:creator>Aruna</dc:creator>
		<pubDate>Tue, 23 Jun 2009 12:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-639</guid>
		<description>Hi

Please let me know the solution!
I tried as u said, its not working :(

Thanks
Aruna</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Please let me know the solution!<br />
I tried as u said, its not working <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Thanks<br />
Aruna</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumargandhi</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-489</link>
		<dc:creator>kumargandhi</dc:creator>
		<pubDate>Mon, 09 Mar 2009 08:23:54 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-489</guid>
		<description>Hi,

Can you mail me the code sample.

regards,
kumar.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Can you mail me the code sample.</p>
<p>regards,<br />
kumar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Rieger</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-487</link>
		<dc:creator>Steven Rieger</dc:creator>
		<pubDate>Mon, 09 Mar 2009 06:25:33 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-487</guid>
		<description>I&#039;m still struggling with the focus issue.

Trying all your suggestions still not working.  Also using Firefox.  Here is my code. . .

Can you help?




	
		
	

	
	
		
		
			
		
		
			
		
	
	
</description>
		<content:encoded><![CDATA[<p>I&#8217;m still struggling with the focus issue.</p>
<p>Trying all your suggestions still not working.  Also using Firefox.  Here is my code. . .</p>
<p>Can you help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexwebmaster</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-483</link>
		<dc:creator>Alexwebmaster</dc:creator>
		<pubDate>Tue, 03 Mar 2009 09:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-483</guid>
		<description>Hello webmaster 
I would like to share with you a link to your site 
write me here preonrelt@mail.ru</description>
		<content:encoded><![CDATA[<p>Hello webmaster<br />
I would like to share with you a link to your site<br />
write me here <a href="mailto:preonrelt@mail.ru">preonrelt@mail.ru</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumargandhi</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-412</link>
		<dc:creator>kumargandhi</dc:creator>
		<pubDate>Fri, 09 Jan 2009 04:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-412</guid>
		<description>Hi,

To resolve this problem we got to get the focus.Use this line addedToStage=&quot;stage.focus=null;&quot; , it will bring the focus to the current stage and sets the focus.Like if the Textfield is in TitleWindow so add this line to the TitleWindow.

regards,
kumar.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>To resolve this problem we got to get the focus.Use this line addedToStage=&#8221;stage.focus=null;&#8221; , it will bring the focus to the current stage and sets the focus.Like if the Textfield is in TitleWindow so add this line to the TitleWindow.</p>
<p>regards,<br />
kumar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joss</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-406</link>
		<dc:creator>joss</dc:creator>
		<pubDate>Wed, 07 Jan 2009 15:09:05 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-406</guid>
		<description>I&#039;m having the same issue. the focus is &#039;drawn around a text input filed but you cannot write into it. (I&#039;m also havign a problem where you cannot click on teh field and hten write into it so there may be some other problem at work here.)

however, i am also having trouble setting focus to teh first of a group of radio buttons or checkboxes.</description>
		<content:encoded><![CDATA[<p>I&#8217;m having the same issue. the focus is &#8216;drawn around a text input filed but you cannot write into it. (I&#8217;m also havign a problem where you cannot click on teh field and hten write into it so there may be some other problem at work here.)</p>
<p>however, i am also having trouble setting focus to teh first of a group of radio buttons or checkboxes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wallville</title>
		<link>http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-349</link>
		<dc:creator>wallville</dc:creator>
		<pubDate>Wed, 12 Nov 2008 15:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://flexonblog.wordpress.com/2008/01/01/using-setfocus-method-to-bring-focus-to-a-textinput-control/#comment-349</guid>
		<description>This does not put the cursor into the field, it only sets the focus into the field.  does anyone know how to load an application and place a cursor into a specific text field on creationComplete?</description>
		<content:encoded><![CDATA[<p>This does not put the cursor into the field, it only sets the focus into the field.  does anyone know how to load an application and place a cursor into a specific text field on creationComplete?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
