yeah, what i've built *is* a rich text editor- the built in one didn't have any methods for inserting formatted text that i saw, only applying formats to existing selections.
I pretty much kept the 2 functions (setTextStyles and getTextStyles), which i'm sure is where I saw textArea.getTextField() used, so I assumed it was OK to use. I'm building an editor that contains a combobox used to insert text into the textArea, so I need to be able to insert text at a cursor position that is styled in some way. I think inserting a TextRange object at a cursor position would be the way to go, just haven't figured out how to do that yet. thanks again d. On Fri, Apr 11, 2008 at 5:16 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > TextArea does not "officially" support multiple text styles. Use > RichTextEditor instead. > > > > By using getTextField() you are using unsupported APis that could go away > in a future release. > > > ------------------------------ > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *Derrick Anderson > *Sent:* Friday, April 11, 2008 12:57 PM > *To:* [email protected] > *Subject:* Re: [flexcoders] insert at cursor position in textarea > > > > i was able to do it w/out subclassing like so: > > private function handleMergeFieldClick(event:*):void > { > textArea.getTextField().replaceSelectedText('['[EMAIL PROTECTED] > +']'); > } > > works like a charm, except now I realize I would like some color applied > to the text that was inserted. is there a similar function like > replaceSelectedText but that will replace selected text with a TextRange > object? > > thanks, > d. > > On Fri, Apr 11, 2008 at 2:16 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > No method on TextArea, but you can subclass and get to the underlying > TextField and call replaceSelectedText > > > ------------------------------ > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *Derrick Anderson > *Sent:* Friday, April 11, 2008 7:19 AM > *To:* [email protected] > *Subject:* [flexcoders] insert at cursor position in textarea > > > > hey does anybody know how to insert a string at the current cursor > position in a textarea? i thought there was a method like > textArea.insertTextAt() but i can't find anything like that. > > thanks, > d. > > > > >

