Question

Flex 4.6

I have a httpservice returning a xml schema, with some tags containing html.

When I try to display this in either s:RichText or mx:Text htmlText i get [object Object].

Do I need to break out the return string (meta.html) further?

thx Art.

html/xml HTTPService return

<MYHTML><b><font color="#000000" size="10">This text is 10 point black, italic, and bold.</font></b></MYHTML>

calling code

<s:HTTPService id="getSomeData" url="http://myUrl.com/" useProxy="false" method="POST"
               result="getResult(event)">
</s:HTTPService>

<fx:Script>
<![CDATA[
[Bindable]
public var meta:Object;

public function getResult(event:ResultEvent) : void{
meta = event.result;
if(meta.hasOwnProperty("MYHTML")){
    myDisplay.text = meta.MYHTML;
    myHtmlDisplay.htmlText = meta.MYHTML;
   }                    
}
]]>
</fx:Script>
<s:RichText id="myDisplay" >
</s:RichText>   
<mx:Text id="myHtmlDisplay" >
</mx:Text>
Était-ce utile?

La solution

Set resultFormat property of your HTTPService instance to text.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top