var fm = getFocusManager();
fm.setFocus(MyTextField);
Selection.setSelection(0,MyTextField.text.length)

Philippe Maegerman


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Allen Manning
Sent: mercredi 10 août 2005 14:32
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Caret positioning problem

Mika,

 

Have you looked at:

 

Selection.setSelection(stringLength,stringLength)

 

 

HTH,

Allen

www.prismix.com/

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Mika Kiljunen
Sent: 10 August 2005 13:25
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Caret positioning problem

 

Hi,

I'm trying to set the caret to the end of the textfield. I have a keyUp event handler that adds the dot "." automatically for the text entered. The problem is that when the dot is added by actionscript the caret stays behind the added dot while typing, so the dot gets misplaced and the typing comes out wrong. How can I position the caret AFTER the autoinserted dot? I've tried to fool around with the Selection class functions but none of it seems to help..

 

Here is an example of the handler I'd like to use:

 

function onKeyUp( event )

            {

            if( MyTextField.text.length == 2 )

                        {                      

                        MyTextField.text = MyTextField.text + ".";

                        // HOW TO POSITION THE CARET HERE SO THAT IT COMES OUT LIKE THIS ON TEXTFIELD: "myenteredtext.CARET_BLINKING_HERE???

                        }

            }

 

-Mika




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY**

This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.

We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.
------------------------------------------------------------------

Reply via email to