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

**URL:** <https://forum.kirupa.com/t/get-to-an-objects-content-from-an-objects-event-handler/264395>\
**Category:** flash\
**Created:** [June 25, 2008, 6:52pm UTC](https://forum.kirupa.com/t/get-to-an-objects-content-from-an-objects-event-handler/264395 "2008-06-25T18:52:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![benh](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@benh](https://forum.kirupa.com/u/benh)\
**Post date:** [June 25, 2008, 6:52pm UTC](https://forum.kirupa.com/t/get-to-an-objects-content-from-an-objects-event-handler/264395/1 "2008-06-25T18:52:39Z")

</div>

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”:

```auto

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

---

<div class="post-metadata">

**Author:** ![Dom\_1](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dom\_1](https://forum.kirupa.com/u/Dom_1)\
**Post date:** [June 25, 2008, 6:59pm UTC](https://forum.kirupa.com/t/get-to-an-objects-content-from-an-objects-event-handler/264395/2 "2008-06-25T18:59:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benh](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@benh](https://forum.kirupa.com/u/benh)\
**Post date:** [June 26, 2008, 9:15am UTC](https://forum.kirupa.com/t/get-to-an-objects-content-from-an-objects-event-handler/264395/3 "2008-06-26T09:15:22Z")

</div>

Thats the fella! Brilliant stuff Dom thank you!
