views:

136

answers:

1

HTTPService has a property resultFormat which can be set to any of the following: array e4x flashvars object text xml

I looked at the documentation to understand the difference, but still couldn't understand when to use each. I'm looking for the lightest weight of all of them.

P.S. I'm consuming output from my own server, so can change the output format as needed to make it compatible with each.

+1  A: 

Most of the time either object or e4x is used. The "object" option automatically converts XML to ActionScript objects. This is usually my preferred way to load data from a server when using HTTPService. The e4x option keeps the XML data as XML and then uses the EcmaScript 4 XML notation to query / modify the XML structure. I personally find e4x painful to debug so I usually avoid it.

If you are looking for great performance then you should consider using AMF instead of XML. There are numerous open source server-side implementations of AMF. So picking one depends on your back-end. No matter which one you choose you will likely use the RemoteObject library instead of HTTPService.

There are examples of HTTPService and RemoteObject in Tour de Flex.

James Ward
Hi James, thanks for the reply. I use remoting too, but for this one I have to use HTTPService for sessioning reasons. remoting doesn't have sessions built in.
tag