views:

355

answers:

3

So for a summer project I am thinking of writing a colaborative code editing application in Flex. In order to do this I need to be able to modify individual lines or characters in a text area as different user's modify the same document.

I think I've heard of Flex 4 having support for text primitives but that is still in development. Is there any way to modify or get the individual lines in a text area?

Also if anyone could shed some light on how text areas/editors store and process the text it displays, this would be very helpful. I've been diving into the source code but am still struggling to wrap my head around it.

Thanks!

A: 

I believe you can bind htmlText of a TextArea. It will dispatch a htmlTextChanged event when there is a change that you can respond to. I do not know if this will be comprehensive enough for what you are trying to accomplish (May be necessary to roll out a editor from scratch?).

CookieOfFortune
+1  A: 

If you're willing to work with the beta, you can work with the stuff in flex 4 now:

http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Text+Primitives

quoo
A: 

Why don't you use the htmlText property, and add markup manually to the text string? That might be your simplest option. Otherwise, you can dig into the internal textfield property and monkey around with the selectionIndex properties and set the textFormat on the range. Look at the TextField / TextFormat stuff in the flash documentation.

Not sure exactly how to accomplish it via the TextArea, but I guarantee it will be frustrating...

Glenn