I’m trying to show an image movieclip in the same line as that of the text in a TextArea Component but it seems that you cannot use <img> tag without preceding <p> tag. I tried numerous workarounds for that but couldn’t help.
plz help guys…
Note : “htmltext_problem_” is the name of my mxml.
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundGradientColors="[#FFFFFF, #FFFFFF]" width="300" height="300">
<mx:Script>
<![CDATA[
[Embed(source="../assets/smCofee.swf" , symbol='cofee1')]
public var cofee1:Class;
public function loadText():void
{
var path:String = "htmltext_problem_" + "cofee1";
var str:String = "<p><img width='14' height='14' hspace='10' vspace='10' src='" + path + "'/></p>";
var html:String = txt.htmlText;
//following line replaces (A) with str
txt.htmlText = html.split("(A)").join(str);
}
]]>
</mx:Script>
<mx:TextArea id="txt" width="268" height="223" htmlText="Hi. whats (A) up? Am well "
creationComplete="loadText()" />
</mx:Application>