问题
I would like to display some smiley's inbetween text in my chatbox but when i add an image it gets displayed on a seperate line...
Any ideas?
<mx:TextArea id="myChat" width="271" height="238" backgroundColor="#ffffff" borderThickness="0" editable="false" enabled="true" horizontalScrollPolicy="off" wordWrap="true">
<mx:htmlText>
<![CDATA[
<font size='14'> some text - </font><img src='images/emoticons/wink_smile.gif' height='15' width='15'/><font size='14'> more text</font>
]]>
</mx:htmlText>
</mx:TextArea>
回答1:
Unfortunately Flash's support for the img
tag in text fields is subpar; even in the official Flex 3 documentation it says:
"Note: The <img> tag is not fully supported, and might not work in some cases."
There's an issue in the Adobe bug tracker that seems to describe the exact problem you're having.
In any case, Valentin Manthei seems to have a solution for this. I haven't tried it myself, though.
来源:https://stackoverflow.com/questions/258418/displaying-an-image-inline-in-textarea-htmltext