# XML loader and AS3 class

**URL:** https://forum.kirupa.com/t/xml-loader-and-as3-class/317449
**Category:** flash
**Created:** [December 21, 2010, 1:30am UTC](https://forum.kirupa.com/t/xml-loader-and-as3-class/317449 "2010-12-21T01:30:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![edtech](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@edtech](https://forum.kirupa.com/u/edtech)
#### Post date: [December 21, 2010, 1:30am UTC](https://forum.kirupa.com/t/xml-loader-and-as3-class/317449/1 "2010-12-21T01:30:42Z")

</div>

I have got a problem with this little piece of code in my FLA timeline

```auto
source="myData.xml" 

```

which I want to add to an AS class which has the following:

```auto
private var mysource:String

```

and then this:

```auto
public function set source(s:String):void
  {
      mysource = s;
      var loader:URLLoader = new URLLoader(new URLRequest(mysource));
      loader.addEventListener(Event.COMPLETE, sourceLoaded);
  }

```

Could anyone help me how to put somewhere in the class to load properly?
