Again, another post on how the Flex RichTextEditor blows goats… I’ve now completely taken the source from it, and made methods public or protected for extending in addition to adding the xhtmlText property… You can now override styling in the RichTextEditor and inject inline styles into things like a href tags…

Application Source

This post is in direct relation with my post a few days ago on Customizing the Rich Text Editor

This new post adds an example tab that shows when you put in a link in the TextEditor it underlines it in the TextArea… rather than the ridiculous previous Flex RichTextEditor just leaving it blank, and only changing the cursor when hovering over the tag… I hate how it doesnt actually underline the link in the text editor… so I needed to override the setTextStyles() method… it’s all about overriding the setTextStyles… and you just can’t do that with the default Flex RTE…

I scrapped the default RTE and copied and pasted out the code… I don’t think we will run into any backwards compatibility problems because its just an mxml class. After taking the code, I made sure to at least put some updated comments in the top of the file ACJEditor.mxml… I documented that I adjusted the setTextStyles function to now take a new parameter called tf…

tf is a TextFormat class in flash, any change event in the RTE hits up the setTextStyles and you can pass it your own manipulated TextFormat. You can do a little bit more with this… now you can manipulate the htmlText fairly easily to at least show your changes… I used it to show an underline underneath the <a href > tags… I don’t quite have this working on load, it only seems to be happening on the addition of a link… I’m working on that, but pretty much prototyping right now to show it’s at least now possible… where as with the Flex RTE it just wasn’t… you couldn’t do jack squat because everything was private…

so please feel free take a shot at the new example, and get the source… feel free to manipulate it, and please BLOG ABOUT IT! it helps the community…

I’ve also gotten quite a few comments with the other post Customizing the Rich Text Editor and one of them mentions having an image show up inside the text editor… frankly i’m not even sure if this is possible at all… i haven’t fully looked at the TextFormat class yet, but because TextFormat is really what is formatting the html it is internal to flash… so as far as that goes, and getting it to actually show up in a textArea… I really am not to sure about that…

Application Source

anyway… i suppose thats enough ramblings for now.