【问题标题】:ObjectProxy to TextFlow (html) in FlexFlex 中的 ObjectProxy 到 TextFlow (html)
【发布时间】:2014-08-14 14:40:55
【问题描述】:

我正在尝试将 ProxyObject 转换为 TextFlow,以便可以在 RichText 中输出。 我正在通过 http 请求接收 ProxyObject。

<s:HTTPService id="httpStoryDetail" url="{urlDetails}"/>

服务得到一个 php 脚本,输出如下:

<user>username</user>
<story><p>Here some text which has <b>html</b> tags.<p><story>

我正在尝试获取故事,以便将其绑定到 RichText,但这需要 TextFlow。 我怎么做?或者有更好的选择吗?

谢谢

【问题讨论】:

    标签: php apache-flex proxy flex4 flex4.7


    【解决方案1】:

    你需要从你的 HTTPService 中获取字符串,例如你得到字符串 "&lt;p&gt;Here some text which has &lt;b&gt;html&lt;/b&gt; tags.&lt;p&gt;" 之后,您将能够将此字符串设置为 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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多