O'Reilly logo

Learning ActionScript 3.0 by Zevan Rosser, Rich Shupe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. XML and E4X

XML, which stands for Extensible Markup Language, is a structured, text-based medium for exchanging data. XML is tag-based, like HTML, but is designed for organizing information rather than controlling visual display. Instead of a relatively large library of tags used to lay out pages and build interfaces, XML is wide open with only a handful of preexisting tags that are strictly for administrative purposes. This freedom allows you to structure data in a way that is most efficient for your needs.

E4X (ECMA for XML) is the current World Wide Web Consortium (WC3) standard for reading and writing XML documents, and greatly reduces the amount of code and hoop-jumping required to communicate with XML. It allows you to treat XML objects like any other object with familiar dot syntax, and provides additional shortcuts for traversing XML trees.

In this chapter you'll learn the essentials of E4X. We'll cover:

  • Understanding XML Structure. XML's flexibility means you can set up files in a manner that best serves your project's requirements. Unlike other tag-based languages, there's no library of tags to memorize—just a few simple rules to follow.

  • Reading XML. Reading and parsing XML files is significantly easier using E4X than when using prior versions of ActionScript. You can find specific single pieces of information, as well as sweep through the entire document, using simple properties and methods that are consistent with other ActionScript objects.

  • Writing XML. You can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required