Structuring a tree chart
There are many types of trees in the virtual world, although the most intuitive one is a family tree. A family tree is a bit more complex than a basic data tree such as a class inheritance tree, as for the most part classes have only one parent while family trees usually have two.
We will build an inheritance tree for the display objects of ActionScript 3.0.
Getting ready
Please note that this sample is cutting edge in HTML5. One of the new features that no one really knows whether will get adopted or not is E4X. It's been embraced by Firefox, but not all browsers have implemented it (it is fully supported in Flash as well).
ECMAScript for XML (E4X) is a programming language extension that adds native XML support to ECMAScript. It has replaced the DOM interface and is implemented as a primitive (such as numbers and Booleans), making it faster and more optimized.
As we are mainly working locally, we are going to save our XML document directly in our JavaScript to avoid...