XML to Array

Hello,

I need your help.

/* xml file*/
<?xml version=“1.0” encoding=“ISO-8859-1”?>
<data>
<news>
<newstitle>title+1</newstitle>
<newsitem>text+1</newsitem>
<newsurl></newsurl>
</news>
<news>
<newstitle>title+2</newstitle>
<newsitem>text+2</newsitem>
<newsurl></newsurl>
</news>
<news>
<newstitle>title+3</newstitle>
<newsitem>text+3</newsitem>
<newsurl></newsurl>
</news>
</data>

In the script below I parse the XML file to an array:

class controlClass
{
var firstChild;
function controlClass()
{
}
function createXMLArray(XMLobj, URL)
{
_root[XMLobj] = new Array({});
var xmlXML = new XML();
xmlXML.ignoreWhite = true;
xmlXML.onLoad = function (success)
{
if (success)
{
var l1 = firstChild.childNodes;
for (var l2 in l1)
{
_root[XMLobj][l2] = {};
var l3 = l1[l2].childNodes;
for (var l4 in l3)
{
_root[XMLobj][l2][l3[l4].nodeName] = l3[l4].firstChild;
}
}
}
};
xmlXML.load(URL, xmlXML, “POST”);
}
}

I call the createXMLArray from the following main program (.fla):

_global.Control = new controlClass();
Control.createXMLArray(“newsXML”, “news.xml”);

This works.

What I am unable to do is to access the data in newsXML array, especially those related to a particular nodename, writing for example:

trace(_root.newsXML[0].newstitle);

Problem of variable scope or anything else?

Your help is welcome!

Sylvie