我正在尝试将ProxyObject转换为TextFlow,这样我就可以在RichText中输出。我正在通过http请求接收ProxyObject。
<s:HTTPService id="httpStoryDetail" url="{urlDetails}"/>该服务转到一个php-script,输出如下:
<user>username</user>
<story><p>Here some text which has <b>html</b> tags.<p><story>我正在尝试获取故事,以便可以将其绑定到RichText,但这需要一个TextFlow。我该怎么做?或者,有没有更好的选择呢?
谢谢
发布于 2014-08-14 23:13:54
你需要从你的HTTPService中获取字符串,例如你得到字符串"<p>Here some text which has <b>html</b> tags.<p>“之后,你就可以将这个字符串设置为RichText。
//Must be your string
var richText:String = "<p fontSize=\"10\">A small normal paragraph</p>" +
"<p fontSize=\"14\" fontWeight=\"bold\">A medium bold paragraph</p>" +
"<p fontSize=\"18\">A large<span fontStyle=\"italic\">mixed-text paragraph</span></p>"
myRichText.textFlow = TextFlowUtil.importFromString(
richText, WhiteSpaceCollapse.PRESERVE);https://stackoverflow.com/questions/25310883
复制相似问题