try this:
Selection.setFocus(combo);
Selection.setSelection(combo.text.length, combo.text.length);

This should set focus to the combobox, then set the selection to the 
end of the combobox.  :)

Dustin Mercer 


--- In [email protected], "Andora, Greg" <[EMAIL PROTECTED]> 
wrote:
> Unfortunately, that doesn't seem to be doing anything.  I have the 
code I'm
> using to try and test this below.  In the test, I am just trying 
to give
> focus to the field not changed and de-select the text within it.
>  
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx=" <http://www.macromedia.com/2003/mxml>
> http://www.macromedia.com/2003/mxml";>
>  <mx:Script>
>  <![CDATA[
>   private function giveFocus(){
>    combo.setFocus();
>    Selection.setFocus(combo.text.length, combo.text.length);
>    combo.open();
>   } 
>   private function giveTextFocus(){
>    myText.setFocus();
>    Selection.setFocus(myText.text.length, myText.text.length);
>   }
>  ]]>
>  </mx:Script>
>  
>  <mx:Array id="dp">
>   <mx:String>Brother</mx:String>
>   <mx:String>Mom</mx:String>
>   <mx:String>Dad</mx:String>
>   <mx:String>Sister</mx:String>
>   <mx:String>Uncle</mx:String>
>  </mx:Array>
>  
>  <mx:Canvas>
>   <mx:ComboBox editable="true" y="25" id="combo" 
change="giveTextFocus()"
> text="{myText.text}" width="200" dataProvider="{dp}" 
selectedIndex="0" />
>   <mx:TextInput id="myText" text="{combo.text}" change="giveFocus
()"
> width="200"/>
>  </mx:Canvas>
> </mx:Application>
> 
> 
> -----Original Message-----
> From: JesterXL [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 18, 2005 5:17 PM
> To: [email protected]
> Subject: Re: [flexcoders] Unselecting text in a field using AS
> 
> 
> 
> Selection.setFocus(yourField.text.length, yourField.text.length);
>  
> ----- Original Message ----- 
> From: Andora, Greg <mailto:[EMAIL PROTECTED]>  
> To: '[email protected]' 
<mailto:'[email protected]'>  
> Sent: Friday, March 18, 2005 8:13 PM
> Subject: [flexcoders] Unselecting text in a field using AS
> 
> 
> If I use actionScript to send focus to a textInput or editable 
comboBox Flex
> automatically selects the contents in that field.  Is there a way 
I can
> unselect the text?  I've tried resetting the value of the text 
property, but
> it doesn't unselect the contents.  What I'd like to do is unselect 
the
> contents and move the cursor to the end of the text in the field. 
> 
> Thanks in advanced, 
> Greg 
> 
> 
> ----
> This email may contain confidential and privileged material for 
the sole use
> of the intended recipient(s). Any review, use, distribution or 
disclosure by
> others is strictly prohibited. If you are not the intended 
recipient (or
> authorized to receive for the recipient), please contact the 
sender by reply
> email and delete all copies of this message.
> 
> To reply to our email administrator directly, send an email to
> [EMAIL PROTECTED]
> 
> Littler Mendelson, P.C.
> http://www.littler.com
> 
> 
> 
> 
> 
> Yahoo! Groups Sponsor 
> 
> ADVERTISEMENT
>  
> 
<http://us.ard.yahoo.com/SIG=1295t8to1/M=298184.6191685.7192823.30011
76/D=gr
> 
oups/S=1705007207:HM/EXP=1111281393/A=2593423/R=0/SIG=11el9gslf/*http
://www.
> netflix.com/Default?mqso=60190075> click here 
>  
> <http://us.adserver.yahoo.com/l?
M=298184.6191685.7192823.3001176/D=groups/S=
> :HM/A=2593423/rand=934458204>         
> 
> 
>   _____  
> 
> Yahoo! Groups Links
> 
> 
> *     To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
> <http://groups.yahoo.com/group/flexcoders/> 
>   
> 
> *     To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]
subject=Unsubscribe> 
>   
> 
> *     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service
> <http://docs.yahoo.com/info/terms/> . 
> 
> 
> 
> ----
> This email may contain confidential and privileged material for 
the sole use of the intended recipient(s). Any review, use, 
distribution or disclosure by others is strictly prohibited. If you 
are not the intended recipient (or authorized to receive for the 
recipient), please contact the sender by reply email and delete all 
copies of this message.
> 
> To reply to our email administrator directly, send an email to
> [EMAIL PROTECTED]
> 
> Littler Mendelson, P.C.
> http://www.littler.com





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to