# myXml.load() not calling onLoad

**URL:** <https://forum.kirupa.com/t/myxml-load-not-calling-onload/173948>\
**Category:** flash\
**Created:** [December 31, 2005, 7:29am UTC](https://forum.kirupa.com/t/myxml-load-not-calling-onload/173948 "2005-12-31T07:29:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdd](https://avatars.discourse-cdn.com/v4/letter/k/ecb155/32.png) [@kdd](https://forum.kirupa.com/u/kdd)\
**Post date:** [December 31, 2005, 7:29am UTC](https://forum.kirupa.com/t/myxml-load-not-calling-onload/173948/1 "2005-12-31T07:29:21Z")

</div>

[edit: i had some problem in my xml file, and the variable i was sending to php was a string instead of an integer. so ignore the whole post right now, i’ll update the situation. thanks anyways though.]

i’ve 2 xml files. first one loads perfectly. 2nd is supposed to load when a function is called. i debugged it, and when i click the mc, it calls the function.  
this function has basic procedure to open xml file, and read. here they are:

```auto

loadIt = function()
{
xmlData = new XML();
xmlData.load("filename");
}
 
xmlData.onLoad = function(success)
{
//do the things...
}

```

NOW, i have the same thing for the FIRST file. but the names are different, EXCEPT success.

the line “xmlData.load(“filename”);” doesn’t call xmlData.onLoad at all. what’s wrong? :sigh:

i even tried this:

```auto

loadIt = function()
{
xmlData = new XML();
xmlData.load("filename");
 
xmlData.onLoad = function(success)
{
//do the things...
}
}

```

as you can see, the onLoad function is inside loadIt function.

edit: also, if you run swf file (that parses xml data) more than once in a very short time, does it always give you “cannot load file” trace message? or does the file get parsed?
