0 Replies Latest reply on Jul 12, 2009 5:55 PM by SilentChris

    Using <img> tag with htmlText

    SilentChris Level 1

      I'm trying to display images within mx:Text components using htmlText.  However, no matter what I try, I can't get an image to display.  The application just displays whitespace where the <img> tag is.  My current code looks something like:

       

                  <mx:Text id="test_html" width="100%" height="100%">
                      <mx:htmlText>
                          <![CDATA[
                              <p>Why can't I include an image =(</p><img src='assets/add_icon.gif' width='20' height='20' align='left' hspace='10' vspace='10' />
                          ]]>
                      </mx:htmlText>
                  </mx:Text>

       

      What I get displayed when I view this is:

       

      Picture 6.png

       

      I've tried essentially every permutation that I can think of -- setting the htmlText in actionScript, using all different paths (app:/assets/add_icon.gif, ../assets/add_icon.gif, add_icon.gif, embedding the image and using {<classname>.addIcon}).  I have other images embedded in the application using the path "../assets/<image file>" and they work fine (they're not being used in htmlText).

       

      Has anyone had this kind of trouble before?  Any idea what might be going wrong?