# Stuck on Designing a Rich Text Editor in Flash

**URL:** https://forum.kirupa.com/t/stuck-on-designing-a-rich-text-editor-in-flash/191789
**Category:** flash
**Created:** [June 23, 2006, 1:30am UTC](https://forum.kirupa.com/t/stuck-on-designing-a-rich-text-editor-in-flash/191789 "2006-06-23T01:30:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thesilenthare](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@thesilenthare](https://forum.kirupa.com/u/thesilenthare)
#### Post date: [June 23, 2006, 1:30am UTC](https://forum.kirupa.com/t/stuck-on-designing-a-rich-text-editor-in-flash/191789/1 "2006-06-23T01:30:15Z")

</div>

Hello all

I am trying to make a simple rich text editor in flash. I have a couple questions:

Firstly, I am using a TextField object of type input as the text input area of the text editor. So I am wondering, in your opinion, what would work best for formatting the text in this field?

-CSS StyleSheet  
-TextFormat Object with the built in TextFormat paramaters  
-Simple HTML and the htmlText property of the TextField object.

Remember the text will always be changing at the user’s whim in the movie, and I am looking for simplicity in applying certain styles to only selected portions of the input text and also setting styles for all future text that is input beyond what is already input (Could be a different style than that of the text already input)

I am currently trying the second option (TextFormat Object), but I am open to any suggestions.

Secondly, I am having a little trouble with the TextFormat Object option. I have a textfield, and a toolbar movieclip (with buttons such as bold, underline, italics, etc) on my stage. I am writing an actionscript class for the toolbar. I want to be able to capture the start index and end index of highlighted text in the textbox, so that say when I press the bold button, the text is bolded or unbolded. I have tried using Selection.getStartIndex() and Selection.getEndIndex() but they have not yet worked for me, as the selection loses focus when I click on the toolbar in the movie. I was hoping there was some sort of onHighlightText handler for the Selection class, so that I can capture the start and end indices whenever text is highlighted. However, there appears to be nothing with that functionality.

All help is appreciated. Thanks in advance.

-thesilenthare
