# Can't import XML data

**URL:** <https://forum.kirupa.com/t/cant-import-xml-data/260376>\
**Category:** flash\
**Created:** [May 14, 2008, 10:53pm UTC](https://forum.kirupa.com/t/cant-import-xml-data/260376 "2008-05-14T22:53:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackpool](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@blackpool](https://forum.kirupa.com/u/blackpool)\
**Post date:** [May 14, 2008, 10:53pm UTC](https://forum.kirupa.com/t/cant-import-xml-data/260376/1 "2008-05-14T22:53:44Z")

</div>

I’m doing the tutorial here : [http://www.kirupa.com/developer/flashcs3/using\_xml\_as3\_pg2.htm](http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg2.htm)

And when I type in the code to load in the XML, I get the following error:

1046: Type was not found or was not a compile-time constant: XML.

This is the code:

```auto
 var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
 
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
 
xmlLoader.load(new URLRequest("http://www.kirupa.com/net/files/sampleXML.xml"));
 
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
trace(xmlData);
}

```

What am I missing?

---

<div class="post-metadata">

**Author:** ![blackpool](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@blackpool](https://forum.kirupa.com/u/blackpool)\
**Post date:** [May 14, 2008, 11:04pm UTC](https://forum.kirupa.com/t/cant-import-xml-data/260376/2 "2008-05-14T23:04:02Z")

</div>

Update, after reading this: [http://www.kirupa.com/forum/showthread.php?t=292705&highlight=1046%3A](http://www.kirupa.com/forum/showthread.php?t=292705&highlight=1046%3A)

I can only assume it was a dammaged file. Event though I kept creating a new file, I changed the partition it was saved on and it now works. Go figure.
