views:

273

answers:

2

actually i got to the cause of the issue.

if you feed the textarea text attribute with an tag that has a valid src url, then for some reason flex will try to render everything as html.

Eg, try this:

<mx:TextArea id="textArea" width="100%" height="90%" text="<img src='http://url-to-a-valid-img"/&gt; 

and instead of it rendering it as raw text it will render it as an html.

any idea?

A: 

Really? I cannot even get it to compile with the < symbol there. Have you tried converting using &lt;?

adamcodes
flex will try to load the src of the img. I can't convert encode the angle brackets because I am letting the user edit the content. so:<img src="http://sstatic.net/so/img/logo.png" />must still show up as like that and not encoded on the TextArea control.
David
by the way, i also tried what you did, you are right, flex doesn't let you compile, but the content comes from a variable so i just assign it to the text area during run time.
David
A: 

okay, strange i manage to fix this issue. its a weird fix not sure why I had to do it.

But basically, when i copy over the variable's string content into a TextArea htmlText - any img with a valid src seems to get erased.

Its an odd issue that I just want to move on from.

David