# Loading xml in the main constructor is glitchy

**URL:** <https://forum.kirupa.com/t/loading-xml-in-the-main-constructor-is-glitchy/298023>\
**Category:** flash\
**Created:** [October 12, 2009, 5:26pm UTC](https://forum.kirupa.com/t/loading-xml-in-the-main-constructor-is-glitchy/298023 "2009-10-12T17:26:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tibberous](https://avatars.discourse-cdn.com/v4/letter/t/cdc98d/32.png) [@tibberous](https://forum.kirupa.com/u/tibberous)\
**Post date:** [October 12, 2009, 5:26pm UTC](https://forum.kirupa.com/t/loading-xml-in-the-main-constructor-is-glitchy/298023/1 "2009-10-12T17:26:22Z")

</div>

I have a hard to track down bug. Basically, in the main class, in the constructor, I load an xml file.

Sometimes it fails to load, without giving an error. Then, when I refresh the page, it loads.

It seems like it might be some kind of race condition, but I’m not %100 sure. I though about firing the xml loading code off a timer after one second, but that seems messy. Is there a better place to put this even than the constructor? Do you think that is even the problem?
