# htmlText + \<img\> tag + extra line break

**URL:** <https://forum.kirupa.com/t/htmltext-img-tag-extra-line-break/273426>\
**Category:** flash\
**Created:** [October 15, 2008, 12:50pm UTC](https://forum.kirupa.com/t/htmltext-img-tag-extra-line-break/273426 "2008-10-15T12:50:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubs6](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@shubs6](https://forum.kirupa.com/u/shubs6)\
**Post date:** [October 15, 2008, 12:50pm UTC](https://forum.kirupa.com/t/htmltext-img-tag-extra-line-break/273426/1 "2008-10-15T12:50:13Z")

</div>

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.

```auto

<?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>

```
