# Access data from another class?

**URL:** <https://forum.kirupa.com/t/access-data-from-another-class/235689>\
**Category:** flash\
**Created:** [August 14, 2007, 2:44am UTC](https://forum.kirupa.com/t/access-data-from-another-class/235689 "2007-08-14T02:44:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jchambers](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jchambers](https://forum.kirupa.com/u/jchambers)\
**Post date:** [August 14, 2007, 2:44am UTC](https://forum.kirupa.com/t/access-data-from-another-class/235689/1 "2007-08-14T02:44:40Z")

</div>

Hello all –

So I have two classes (classes.XMLLoader) and I am trying to access the xml data from (classes.ActionScripts), but I only get _[COLOR=gray]null[/COLOR]_ returned? The _[COLOR=gray]loader.Data()[/COLOR]_ of _[COLOR=gray]classes.XMLLoader[/COLOR]_ is run before [COLOR=gray]\*xml/movies.xml \*[/COLOR][COLOR=black]has been loaded.[/COLOR]

```auto
  
public function ActionScripts() {
 
   var loader:XMLLoader = new XMLLoader("xml/movies.xml");
 
   trace( loader.Data() ); [COLOR=gray]// null[/COLOR]
 
  }

```

I am sure I will need to use addEventListener, but I have done so without success so far…

Any guidence would be grrrreat!

Thank you,  
Jon
