# XML onLoad only runs once

**URL:** <https://forum.kirupa.com/t/xml-onload-only-runs-once/205237>\
**Category:** flash\
**Created:** [October 27, 2006, 10:36am UTC](https://forum.kirupa.com/t/xml-onload-only-runs-once/205237 "2006-10-27T10:36:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chibitotoro](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@chibitotoro](https://forum.kirupa.com/u/chibitotoro)\
**Post date:** [October 27, 2006, 10:36am UTC](https://forum.kirupa.com/t/xml-onload-only-runs-once/205237/1 "2006-10-27T10:36:46Z")

</div>

Hi. I was wondering if anyone has had the same problem.  
I start my frame by creating an XML object and declaring its onLoad function as follows:

var myXML:XML;  
myXML=new XML();  
myXML.ignoreWhite=true;  
myXML.load(“myfile.xml”);

myXML.onLoad=function(success:Boolean){  
if(success){  
trace(“good”);  
}  
}

Some time later on. I wish to reload the XML object with a different XML file or the same XML file but the onLoad function only runs once! I tried just using a myXML.load call as well as deleting the object, creating a new XML object and loading a new file but none of this works. Any suggestions as to how to tackle this problem?
