Try passing the explicit values to your function:

setFBack(mytext.Selection.getBeginIndex(), mytext,Selection.getEndIndex())

function setFBack(begin:Number, end:Number){
}

OR (Flex 2??):
 public var begin:Number;
 etc..

Maybe one of these will help.

Good Luck

--- In [email protected], "Brian McPheeters"
<[EMAIL PROTECTED]> wrote:
>
> Here is my code. I have tried this with 7,0,35,29 on IE and Firefox.
Seems like some event is changing the Selection after I set it.
>  
>  
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";>
>  <mx:Script>
>   <![CDATA[
>    var begin:Number;
>    var end:Number;
>    function updateSelection() {
>     begin = Selection.getBeginIndex();
>     end = Selection.getEndIndex();
>    }
>    
>    function setFBack() {
>     Selection.setFocus(mytext);
>     Selection.setSelection(begin,end);
>    }
>    
>    
>   ]]>
>  </mx:Script>
>  <mx:TextArea id="mytext" width="500" height="400"
mouseUp="updateSelection()"/>
>  <mx:ComboBox id="cbtest"  change="setFBack()" >
>   <mx:dataProvider>
>    <mx:Array>
>     <mx:String>Macromedia Flex</mx:String>
>     <mx:String>Macromedia Dreamweaver</mx:String>
>     <mx:String>Macromedia ColdFusion</mx:String>
>     <mx:String>Macromedia Flash</mx:String>
>    </mx:Array>
>   </mx:dataProvider> 
>  </mx:ComboBox>
> </mx:Application>
> 
> ________________________________
> 
> From: [email protected] on behalf of Abdul Qabiz
> Sent: Thu 12/15/2005 11:03 AM
> To: [email protected]
> Subject: RE: [flexcoders] Selection.setSelection Issue
> 
> 
> Hi,
>  
> Can you please post the sample code, how are you doing?
>  
> I think, it should work. Which version of Flash Player you are
testing it in?
>  
> -abdul
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Brian McPheeters
> Sent: Thursday, December 15, 2005 1:27 PM
> To: [email protected]
> Subject: [flexcoders] Selection.setSelection Issue
> 
> 
> I am storing the current selected indexes of my TextArea so when
certain events happen on other controls I can setFocus back to the
TextArea and set the selectedText back to where it was. When I do this
the highlighted text is not the same as the positions I submitted but
the indexes seem to get set to -1,-1. Anyone dealt with this before?
>  
> Brian
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> 
> 
> 
> ________________________________
> 
> YAHOO! GROUPS LINKS 
> 
> 
>       
> *      Visit your group "flexcoders
<http://groups.yahoo.com/group/flexcoders> " on the web.
>         
> *      To unsubscribe from this group, send an email to:
>        [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
>         
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 
> 
> 
> ________________________________
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.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