# Importing XML data problem

**URL:** <https://forum.kirupa.com/t/importing-xml-data-problem/267231>\
**Category:** Uncategorized\
**Created:** [July 29, 2008, 10:44pm UTC](https://forum.kirupa.com/t/importing-xml-data-problem/267231 "2008-07-29T22:44:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhelf](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jhelf](https://forum.kirupa.com/u/jhelf)\
**Post date:** [July 29, 2008, 10:44pm UTC](https://forum.kirupa.com/t/importing-xml-data-problem/267231/1 "2008-07-29T22:44:14Z")

</div>

Hi,

I’m doing a papervision3d interface and I what to use an XML file to import some images. I have found out on the internet how to extract XML data in AS3, I using this code :

```auto
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML;
 
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
 
xmlLoader.load(new URLRequest("motion.xml"));
var MotionImg:Array;
function LoadXML(e:Event):void {

xmlData = new XML(e.target.data);

}

```

The problem I have is that I’m not able to access hte xmlData variable outside of the function LoadXML wich is wierd cause I declare this variable outside of the function.

Thank you for your help
