<?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/"
		>
<channel>
	<title>Comments on: Set Cursor Focus in Flex</title>
	<atom:link href="http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/</link>
	<description>experience is everything</description>
	<lastBuildDate>Mon, 23 Apr 2012 02:14:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: jay</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-38</link>
		<dc:creator>jay</dc:creator>
		<pubDate>Thu, 19 Feb 2009 03:05:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-38</guid>
		<description>Thanks a lot, you save my time.</description>
		<content:encoded><![CDATA[<p>Thanks a lot, you save my time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zebulon303</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-34</link>
		<dc:creator>Zebulon303</dc:creator>
		<pubDate>Sun, 21 Dec 2008 11:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-34</guid>
		<description>I confirm it doesn&#039;t work on FF 3.05 ... Anyone has got any idea ?</description>
		<content:encoded><![CDATA[<p>I confirm it doesn&#8217;t work on FF 3.05 &#8230; Anyone has got any idea ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mai Ta</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-25</link>
		<dc:creator>Mai Ta</dc:creator>
		<pubDate>Fri, 17 Oct 2008 03:35:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-25</guid>
		<description>but it not run on FireFox and Safari.
huhuhu</description>
		<content:encoded><![CDATA[<p>but it not run on FireFox and Safari.<br />
huhuhu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mai Ta</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-24</link>
		<dc:creator>Mai Ta</dc:creator>
		<pubDate>Fri, 17 Oct 2008 03:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-24</guid>
		<description>body scroll=&quot;no&quot; onload=&quot;document.getElementById(&#039;${application}&#039;).focus()&quot;
I don&#039;t know why it is lost!</description>
		<content:encoded><![CDATA[<p>body scroll=&#8221;no&#8221; onload=&#8221;document.getElementById(&#8216;${application}&#8217;).focus()&#8221;<br />
I don&#8217;t know why it is lost!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mai Ta</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-23</link>
		<dc:creator>Mai Ta</dc:creator>
		<pubDate>Fri, 17 Oct 2008 03:31:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-23</guid>
		<description>Input it like this : &quot;&quot;
Sorry!</description>
		<content:encoded><![CDATA[<p>Input it like this : &#8220;&#8221;<br />
Sorry!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mai Ta</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-22</link>
		<dc:creator>Mai Ta</dc:creator>
		<pubDate>Fri, 17 Oct 2008 03:29:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-22</guid>
		<description>Hi all!
I had a problem like you.
I tryed to use &quot;document.getElementById(”${application}”).focus();&quot;
the same Rush&#039;s guiding! but it is not action.
I try using by putting it on 

It actions correctly.
But it must have a condition: The control you want to setFocus have cursor, must be set focus.
Cheer!</description>
		<content:encoded><![CDATA[<p>Hi all!<br />
I had a problem like you.<br />
I tryed to use &#8220;document.getElementById(”${application}”).focus();&#8221;<br />
the same Rush&#8217;s guiding! but it is not action.<br />
I try using by putting it on </p>
<p>It actions correctly.<br />
But it must have a condition: The control you want to setFocus have cursor, must be set focus.<br />
Cheer!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rush</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-20</link>
		<dc:creator>Rush</dc:creator>
		<pubDate>Wed, 24 Sep 2008 15:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-20</guid>
		<description>Place the code at the bottom of the script that loads the flash object (in between line 98 and 99).

    document.write(alternateContent);  // insert non-flash content
  }
-------Here------
// --&gt;
&lt;/script&gt;
&lt;noscript&gt;</description>
		<content:encoded><![CDATA[<p>Place the code at the bottom of the script that loads the flash object (in between line 98 and 99).</p>
<p>    document.write(alternateContent);  // insert non-flash content<br />
  }<br />
&#8212;&#8212;-Here&#8212;&#8212;<br />
// &#8211;></p>
<p><noscript></noscript></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graeme</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-19</link>
		<dc:creator>Graeme</dc:creator>
		<pubDate>Wed, 24 Sep 2008 13:57:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-19</guid>
		<description>But where in index.template.html do you put the statement;
document.getElementById(”${application}”).focus();
???
do you have a sample index.template.html to show please?</description>
		<content:encoded><![CDATA[<p>But where in index.template.html do you put the statement;<br />
document.getElementById(”${application}”).focus();<br />
???<br />
do you have a sample index.template.html to show please?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-15</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Wed, 27 Aug 2008 14:56:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-15</guid>
		<description>I finally found the solution as indeed it was a timing problem and I verified it works in Internet Explorer and Firefox and Safari:

    // @see http://www.kirupa.com/forum/showthread.php?t=278510

So now my code is like this:

    addEventListener(FlexEvent.CREATION_COMPLETE, setDefaultFocus);
    ...
    private function setDefaultFocus(event:FlexEvent):void {
        setTimeout(setCursorPosition, 10);
    }
    private function setCursorPosition():void {
        _propertyName.setFocus();
        _propertyName.setSelection(0, 0);
    }</description>
		<content:encoded><![CDATA[<p>I finally found the solution as indeed it was a timing problem and I verified it works in Internet Explorer and Firefox and Safari:</p>
<p>    // @see <a href="http://www.kirupa.com/forum/showthread.php?t=278510" rel="nofollow">http://www.kirupa.com/forum/showthread.php?t=278510</a></p>
<p>So now my code is like this:</p>
<p>    addEventListener(FlexEvent.CREATION_COMPLETE, setDefaultFocus);<br />
    &#8230;<br />
    private function setDefaultFocus(event:FlexEvent):void {<br />
        setTimeout(setCursorPosition, 10);<br />
    }<br />
    private function setCursorPosition():void {<br />
        _propertyName.setFocus();<br />
        _propertyName.setSelection(0, 0);<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>http://robrusher.com/2008/04/28/set-cursor-focus-in-flex/comment-page-1/#comment-14</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Wed, 27 Aug 2008 13:48:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.robrusher.com/?p=34#comment-14</guid>
		<description>I have been battling this issue for the last two days and still cannot get it to work. I think there must be a timing issue involved. It seems like I am always one TAB away from getting it to work! I have implemented your same technique total success. I see the highlight rectangle around my TextFiel, but I have to press another TAB to get the cursor in the TextField. Any suggestions?</description>
		<content:encoded><![CDATA[<p>I have been battling this issue for the last two days and still cannot get it to work. I think there must be a timing issue involved. It seems like I am always one TAB away from getting it to work! I have implemented your same technique total success. I see the highlight rectangle around my TextFiel, but I have to press another TAB to get the cursor in the TextField. Any suggestions?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

