ObjectProxy to TextFlow (html) in Flex

44 Views Asked by At

I'm trying to convert a ProxyObject into a TextFlow so I can output in a RichText. I'm recieving the ProxyObject trough a http-request.

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

The service gots to a php-script with the output as follows:

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

I'm trying to fetch the story so I can bind it to a RichText but that needs a TextFlow. How do I do that? Or is there a better option for doing that?

Thanks

1

There are 1 best solutions below

0
On

You need get string from your HTTPService, for example you get string "<p>Here some text which has <b>html</b> tags.<p>" After that you will be able to set this string to 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);