all groups > flash actionscript > march 2004 >
You're in the

flash actionscript

group:

How to get user selected text?



How to get user selected text? interactiveBoy
3/1/2004 11:07:32 PM
flash actionscript: I'm trying to build an imput form in Flash MX 2004 Pro that has some very
simple formatting tags for HTML. Is it possible to get the string of
characters that are selected in an input text box? I have looked at
textField.getSelected(), textField.setSelected(), etc. But these want specific
character index numbers. I don't know what the index numbers are, because the
user has chosen the text. Any help you can provide would be much appreciated.

Thanks

Gary Ingle
Re: How to get user selected text? Jim Esteban
3/2/2004 12:40:53 AM
Re: How to get user selected text? interactiveBoy
3/2/2004 5:49:37 AM
I've looked at the selection object again, and I still have found no way to
[b]get[/b] the user selected text and replace it with a modified version of
itself. When I use replaceSel it replaces the entire textfield not just the
currently selected characters.

I need the user to be able to type some text, highlight a word and click on a
"bold" button. Let's say they typed "My dog is cute!" and they selected
"cute!", clicked on the bold button...the textfield should then have in it:

My dog is <b>cute!</b>

If you can offer any more advice, I would be most appreciative

Thanks

Gary
Re: How to get user selected text? interactiveBoy
3/2/2004 9:03:35 PM
I'm close to giving up on this. Can user selected text from an input field (just the selected text, not all of it) can be put into a variable?

Thanks

AddThis Social Bookmark Button