# URLLoader repeating itself

**URL:** <https://forum.kirupa.com/t/urlloader-repeating-itself/252341>\
**Category:** flash\
**Created:** [February 19, 2008, 7:34am UTC](https://forum.kirupa.com/t/urlloader-repeating-itself/252341 "2008-02-19T07:34:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjp342](https://avatars.discourse-cdn.com/v4/letter/b/f9ae1b/32.png) [@bjp342](https://forum.kirupa.com/u/bjp342)\
**Post date:** [February 19, 2008, 7:34am UTC](https://forum.kirupa.com/t/urlloader-repeating-itself/252341/1 "2008-02-19T07:34:48Z")

</div>

Hi there,

I’m pretty new to Flash and AS3 but I’ve managed to figure most of my problems out with the help of books and the net…I’m having a problem with a URLLoader and I just cannot work it out.

The problem is that when I click on my buttons that start the function containing the URLLoader, the Loader loads the data repeatedly, as many times as I have clicked on a button. So, for example, if I click a button it will load the data twice. Click again and it loads it three times, again and it loads it four times etc…I know this because I traced the function that runs when the URLLoader is completed (xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded); )

This poses serious problems for me because each time this happens, the loader adds more and more children to the sprite I am loading the data (a simple XML List) and I cannot manipulate the objects correctly. On top of that I’m sure there is a memory problem.

Anyway, I’m sorry this is such a loaded question, but have you run into a problem like this before and do you have any suggestions? Thank you!
