Any concrete advantage of using json over xml with Flash

Good?

From everything I read, it seems that the answer is no, but it was interesting if anyone had a different opinion.

+5
source share
4 answers

JSON is usually a more efficient data encoding method than XML. It matters if download time matters to your application.

Another consideration is whether the E4X request syntax has compelling benefits for your particular use. Perhaps you can do what you want by iterating over the results of a single query string, and the equivalent ActionScript code will be longer when interacting with the parsed JSON.

I would also think if this application should interact with JavaScript code, for example, because the Flash application lives in the browser and needs to communicate with other things on the page. If so, I would go with JSON, because working with XML in a JS browser (unlike modern JS 1.8 with E4X) is much more complicated than working with JSON.

+5
source

XML is a collection of data. This is 90% of hypertext and 10% of data.

JSON has 2 main advantages:

  • . , ( , AJAX).
  • JavaScript, , , , eval(), :

    result = eval(resultStr); var age = result.clients[2].age;

JSON.

+2

- . xml , E4X . 10- , json xml . 1,5 .

+2

JSON JavaScript... JSON , ECMAScript ( ActionScript)... E4X - XML ActionScript, ...

<node attribute="value"><child/><node>, , ... child ? ? nodename node?

JSON string is an anonymous actioncript object ... XML is not ...

In addition, there are the advantages mentioned above: it is smaller and lighter ... and one final advantage in JSON is that it can capture numeric and logical values ​​... this does not apply to XML ... attrib="123"may mean string 123or integer 123... same for true, falseand null...

+1
source

All Articles