Get to an object's content from an object's event handler

Hi there,

I have some code that is intended to get a list of XML file names from a PHP script and then parse the content of the XML files and stick certain data into a big array called “allData”:


var allData:Array = new Array();

var remoteFileNames:GetXMLFileNames = new GetXMLFileNames("http://localhost/getVars/getfilenams.php");
remoteFileNames.addEventListener(GetXMLFileNames.GOT_NAMES, getXMLDataFiles);

function getXMLDataFiles(e:Event):void {
    for each (var fileName:String in remoteFileNames.fileNames) {
        var xmlLoader:XmlLoader = new XmlLoader(fileName);
        xmlLoader.addEventListener(XmlLoader.DATA_PARSED, dataParsed);
    }
}

function dataParsed(e:Event):void {
    trace ("XML data was parsed");    
    allData.push(???.content); // problem here!
}

(Of course there’s also some class files GetXMLFileNames.as and XmlLoader.as that do their stuff) all works well except that I need to get the references to the content property of each object. I guess I do this via the event handler but I’m not sure exactly how? Any one got any ideas?

Many thanks

Ben

allData.push (e.target.data);
you might need to cast that

Thats the fella! Brilliant stuff Dom thank you!