Expand my Community achievements bar.

WDDX to XML Issue

Avatar

Level 1
Hey everyone, I originally posted this in Gen Discussion, but
then thought this was a better place. When I was strictly a
"Flasher" I was able to use PHP to deserialize a WDDX and then
reference the object in Flash. Now that I'm Flexing, I haven't come
across another WDDX until now.



Does Flex 2 have anything built into it maybe in the
HTTPService resultFormat that will allow me to use the event.Result
like an XML so I can do something like x:XML = event.result as XML?



Thanks in advance!!!

1 Reply

Avatar

Former Community Member
Try resultFormat="e4x"... i.e.:





<mx:HTTPService id="hs" url="
http://somewhere/something.wddx"
resultFormat="e4x"

result="handleResult(event)" fault="handleFault(event)" />



<mx:Script>



import mx.rpc.events.FaultEvent;

import mx.rpc.events.ResultEvent;



private var wddxValue:XML;



private function handleResult(event:ResultEvent):void

{

wddxValue = event.result as XML;

}



private function handleFault(event:FaultEvent):void

{

trace("Error: " + event.fault.toString());

}



</mx:Script>