Best Way to Store and Parse XML between classes?

Hi Guys,

I’ve been working in as3 for quite a while now, playing about with various methods of loading in and parsing XML between classes - from storing the XML data using objects, storing it in arrays, or parsing XML nodes directly between their relevant classes.

What I’m really trying to figure out is how best to store - and parse, externally loaded XML throughout my custom classes.

Say, for example, I have an XML file in which I contain my ‘gallery’ and ‘navigation’ settings. What I’m currently doing is loading in the XML, extracting all the attributes in my document class into objects - that I then parse to their related classes for data extraction. i.e.

public class myNavigation extends MovieClip
{
public function myNavigation(navSettings:Object) {
this.x = navSettings.xpos
this.x = navSettings.ypos
}
}
(where navSettingsis the object parsed to the navigation class)

…Simply put, what is the best way to store and parse XML data between classes?

Should I be extracting it all in the document class first, into arrays, or objects? Or simply parsing XML nodes that relate to my custom class, to the class directly? I’ve also heard that looping through XML and storing the data in multi-dimentional arrays that you then parse to your classes is the way to go… i.e.

var navSettingsArray = new Array([display[xpos, ypos]]

var myNav:navigationClass = new navigationClass(navSettingsArray[0][0],
navSettingsArray[0][1]
etc…)

Any help or advice would be greatly appreciated, guys… it’s been bugging me for a very long time.

Many thanks in advance.

Tom.