This content has been marked as final. Show 2 replies
LoadVars follows a traditional internet standard of URL vars. It represents
data in a less structured and more linear, however with clever packaging of
the variable data you can achieve data structure hierachial depths.
XML is more structured, allows for hierachial data structures and follows a
newer industry standard. However depending on the depth of you XML
structure and the efficiency of the parsing code, it can be slower than
using URL vars. You will likely need parsing on both the client and server.
Bottom line is if the data structure is simple, LoadVars is quicker to build
and to run.
As the data structures become more complex, LoadVars puts more burden on the
programming code to determine structure.
Flash, Actionscript and Flash Media Server examples:
May many happy bits flow your way!
"Mad Rhino" <firstname.lastname@example.org> wrote in message
Hi there i have a flash application which retreives data from a MYSQL
That data is loaded by LoadVars, but i have recently been reading up upon
flash8 xml parser and would like to know which method is <b>faster</b> and
<b>more efficient</b> in retreiveing and parsing large amounts of data from
Any advise is much appreciated.
As Lon already stated, XML can produce some overhead. Imagine a boolean value returned by the server: with loadVars, it might look like this:
whereas in XML, it adds a lot of data:
<?xml version="1.0" encoding="UTF-8" ?>
<result><bool value="1" /></result>
(of course, you don't always have to use complete xml documents, Flash can also handle single xml nodes).
XML also needs de-/serialization on server and client side, so I'd say that LoadVars should be faster.
But, on the other hand, xml is a lot easier to use when the data gets complex, which can make it more efficient than LoadVars.
If you have to transfer large amounts of complex data, e.g. complete record sets from a database, then Flash Remoting should be interesting for you. It lets you pass complex objects, like arrays, directly from Flash to the server and vice versa, without any de-/serialization. There's a nice benchmark test between SOAP and Remoting here: http://www.flashorb.com/articles/soap_vs_flash_remoting_benchmark.htm.
XML transfer is not SOAP, but there's not such a big difference (SOAP also uses xml for data transfer), so it should be quite similar to the SOAP results.
More info on Remoting and a good tutorial can be found here: http://www.actionscript.org/tutorials/intermediate/PHP_Remoting/index.shtml