# Xml loading

**URL:** <https://forum.kirupa.com/t/xml-loading/244530>\
**Category:** Uncategorized\
**Created:** [November 19, 2007, 12:40pm UTC](https://forum.kirupa.com/t/xml-loading/244530 "2007-11-19T12:40:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sys64](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@sys64](https://forum.kirupa.com/u/sys64)\
**Post date:** [November 19, 2007, 12:40pm UTC](https://forum.kirupa.com/t/xml-loading/244530/1 "2007-11-19T12:40:54Z")

</div>

Hi people 🍺

Trying to play with XML but first with load that XML.

my code:

```auto

function loadxml(file)
{

var my_xml = new XML();
my_xml.onLoad = function(success)
{
    if (success){
        _root.bar._visible=false; // only for debug
    }
}

my_xml.load(file);

this.onEnterFrame = function()
{
    if (!this.target) return (0);

    var loaded = target.getBytesLoaded();
    var total = target.getBytesTotal(); 
    var percent = Math.floor(loaded/total*100);

    _root.infox.text = percent;
    if (percent>=100)
    {
        _root.infox.text = "Done";
    }

     
}

this.target = my_xml;
}

loadxml("list.xml")

```

with this code I can load and make the preloading perfect, but… how i show some error if list.xml not available?
