Sharath Kumar
Sharath Kumar

Reputation: 145

Adding image to richeditable textarea is not working

I am trying to add an image to my textarea .Everything is fine but i am not getting why this code not works.

Here is my text area(mxml)::

<s:RichEditableText id="insultTxtArea" x="0" y="0" width="90%" height="100%"
                                        color="#000000"  
                                        editable="false" fontFamily="Helvetica" selectable="true" 
                                        textFlow="{TextConverter.importToFlow( insultTxtArea.text, TextConverter.TEXT_FIELD_HTML_FORMAT )}"

                                        styleName="customStyle"

                                        textAlign="left" textDecoration="none"/>

I am adding an image

insultTxtArea.text = "<img src='assets\\insult500.png'>";

But where the fault is??? Thanks in advance

Upvotes: 1

Views: 71

Answers (2)

Sumit
Sumit

Reputation: 729

Try this

<s:RichEditableText id="insultTxtArea">
        <s:textFlow>
            <s:TextFlow>
                <s:img source="assets/insult500.png" width="auto" height="auto" />
            </s:TextFlow>
        </s:textFlow>
    </s:RichEditableText>                                                                                              

Upvotes: 1

amit
amit

Reputation: 337

try:

insultTxtArea.textFlow = TextConverter.importToFlow("your html string", 
          TextConverter.TEXT_FIELD_HTML_FORMAT);

Upvotes: 1

Related Questions