Introduction to XML in Flash
       by senocular

Finding Your Way Around An XML Object
Once you know (or think you know) what is what in a Flash XML instance, it's time to figure out how to extract that what so that you can use it for your evil conquests of world domination... and... other Flash needs too. Navigating an XML object can be just as hard, if not harder, than simply understanding its structure. Though once you understand the structure, navigation becomes a bit easier.

Because arrays are used heavily in storing elements, looping will start to become your favorite pastime when working with XML. Loops (for and while) in Flash allow you to easily cycle through all elements of an array, or, in the case of XML, all the children of an element, allowing you access each one of those nodes individually within each iteration of the loop. Depending on the structure of your XML, for loops may need to be nested in order to loop through elements within elements already being looped through. That's always fun right?

Note: Design XML for Accessibility

If you are in direct control of the structure of your XML file, you may want to try, if possible, to minimize the number of levels in the XML hierarchy. The fewer nested loops you need to implement, the better. There are other ways around nested loops which will be brought up later. But it's important that if you are designing XML to be used primarily in Flash that you design it to be easily navigable.



SUPPORTERS:'s fast and reliable hosting provided by Media Temple.