Flex: Any way to use something like htmlText in Sp

2019-09-01 21:25发布

问题:

I´m using php services to insert text from MySql, to a TextArea. Ok, with mx textarea is working but how do i manage that with spark!?

this is my example with mx:

<mx:TextArea htmlText="{links.comment}"/>

this is an example with spark:

<s:TextArea>
    <s:textFlow>
        <s:TextFlow>
            <s:a href="http://www.google.com/" target="_blank"><s:span color="0xCECB02" textDecoration="none">Something and Something</s:span></s:a>
        </s:TextFlow>
    </s:textFlow>
</s:TextArea>

That works, but how can i take the same "{links.comment}" from MySql!?

回答1:

If you are getting data as an tag format you can solve it by below way: -

<s:TextArea color="0xCECB02" textDecoration="none" textFlow ="{TextFlowUtil.importFromString(links.comment, WhiteSpaceCollapse.PRESERVE)}"/>