【问题标题】:Flex: Any way to use something like htmlText in Spark TextArea?Flex:有什么方法可以在 Spark TextArea 中使用 htmlText 之类的东西?
【发布时间】:2012-11-20 05:50:38
【问题描述】:

我正在使用 php 服务将文本从 MySql 插入到 TextArea。 好的,使用 mx textarea 可以正常工作,但我如何使用 spark 管理它!?

这是我的 mx 示例:

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

这是一个使用 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>

这行得通,但是我怎样才能从 MySql 中获取相同的“{links.comment}”!?

【问题讨论】:

  • 感谢您的回答;但它不起作用。我将 {links.comment} 放在 TextFlow 标签内,它给了我来自 mysql 的数据,但带有所有 html 标签!还有其他解决方案吗?再次感谢..
  • 尝试使用以下代码:- "或"
  • 真是太好了,非常感谢!! “importFromString”是正确的。 ;-)

标签: apache-flex flex4 flash-builder flex4.5 flexbuilder


【解决方案1】:

如果您以标签格式获取数据,您可以通过以下方式解决它:-

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

【讨论】:

    猜你喜欢
    • 2018-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-15
    • 2011-03-09
    • 1970-01-01
    • 1970-01-01
    • 2018-09-29
    相关资源
    最近更新 更多