This problem is happening because your third textfield is the last control in 
the tabOrder in your application. The problem only happens when you tab out of 
the third box - because there are no more controls in the tab order, hitting 
tab give the browser focus. So after the browser gets focus, giving focus to 
your text field makes the Flash Player highlight the field like it has focus, 
but the browser (keyboard) does not have focus.
 
A very simple way to workaround this for now is to add another control to your 
page. Anything that can get focus from a tab event. Like a button, text input, 
whatever. That way, when you hit tab out of the third control, another flex 
control gets focus automatically when the tab event fires and focus stays in 
the flash player and then your focusout event gives the textinput focus and all 
is well.
 
Or you could play around with trapping the keyboard (tab) event and setting the 
focus to your first textinput in that handler (and stopping propogation).
 
Karl
Cynergy

________________________________

From: [email protected] on behalf of dffmyco
Sent: Tue 2/27/2007 12:52 PM
To: [email protected]
Subject: [flexcoders] Re: setFocus - help needed



Unfortunately this did not solve the problem.
Any other suggestions.

Dave

--- In [email protected] <mailto:flexcoders%40yahoogroups.com> , 
"e_baggg" <[EMAIL PROTECTED]> wrote:
>
> Change the line of code in your goTo() method to be:
> 
> focusManager.setFocus(one);
> 
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , 
> "dffmyco" <dffmyco@> wrote:
> >
> > Three text input controls. Tab enabled, tab index 1,2,3. On the 
> > focus out of text control three I run a function to set focus 
back 
> > to text control 1. Text control 1 gets the focus(blue outline) 
but 
> > the cursor is not displayed until I click on the box. What do I 
have 
> > to do to have the cursor appear in the text control.
> > 
> > Thanks, Dave
> > 
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml 
> > <http://www.adobe.com/2006/mxml> " 
> > layout="absolute">
> > <mx:Script>
> > <![CDATA[
> > import mx.core.*;
> > 
> > private function goto():void{
> > one.setFocus()
> > }
> > ]]>
> > </mx:Script>
> > <mx:TextInput x="137" y="77" id="one" tabIndex="1" 
> > tabEnabled="true"/>
> > <mx:TextInput x="137" y="147" id="two" tabIndex="2" 
> > tabEnabled="true"/>
> > <mx:TextInput x="137" y="237" id="three" tabIndex="3" 
> > focusOut="goto()" tabEnabled="true"/>
> > 
> > </mx:Application>
> >
>



 

Reply via email to