Re: [Flashcoders] Text editor - Selection trouble.

2006-04-12 Thread Paul BH
if memory serves, this exact thing is covered in Sam Wan's book on OO programming in actionscript its quite an old book, and the code is AS1, but for what you're doing I think it might just get you where you wanna go... url for the booko:http://www.wheelmaker.org/ On 4/12/06, Magnus Askenbäck

Re: [Flashcoders] Text editor - Selection trouble.

2006-04-12 Thread Magnus Askenbäck
Tack Johan, that worked like a charm! =) .m Johan Karlsson wrote: If I remember correctly using onRelease or even onPress is to late and the selection is already gone. To store the selection indexes you need to use the onMouseDown event. -Original Message- From: [EMAIL PROTECTED]

Re: [Flashcoders] Text editor - Selection trouble.

2006-04-12 Thread Marcelo Volmaro
That´s right, because once you hitted the button, the selection is the button. You need to store the start/end index somewere and then, on the button, use that indexes instead of the Selection functions. An easy way could be to assign into an onEnterFrame a function that checks if the

RE: [Flashcoders] Text editor - Selection trouble.

2006-04-12 Thread Giles Taylor
:13 To: Flashcoders mailing list Subject: Re: [Flashcoders] Text editor - Selection trouble. Tack Johan, that worked like a charm! =) .m Johan Karlsson wrote: If I remember correctly using onRelease or even onPress is to late and the selection is already gone. To store the selection indexes you

Re: [Flashcoders] Text editor - Selection trouble.

2006-04-12 Thread Michael Bedar
I did this a long time ago, and as others have said, you need to use an onMouseDown. You will still lose your selection however.. I ended up storing the selection begin and end an using that to set the selection again after I applied the style. Mike On Apr 12, 2006, at 8:46 AM, Magnus