# Unable to clearInterval correctly

**URL:** https://forum.kirupa.com/t/unable-to-clearinterval-correctly/162965
**Category:** flash
**Created:** [September 18, 2005, 5:54am UTC](https://forum.kirupa.com/t/unable-to-clearinterval-correctly/162965 "2005-09-18T05:54:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![marc0047](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@marc0047](https://forum.kirupa.com/u/marc0047)
#### Post date: [September 18, 2005, 5:54am UTC](https://forum.kirupa.com/t/unable-to-clearinterval-correctly/162965/1 "2005-09-18T05:54:13Z")

</div>

I am creating a preloader using setInterval, and so far so good. The only problem I am having is clearing the interval’s ID name:

```auto

_global.queryload = function(clip, intervalname) {
	clip.bytes_loaded = Math.round(clip.getBytesLoaded());
	clip.bytes_total = Math.round(clip.getBytesTotal());
	trace(clip.bytes_loaded + " / " + clip.bytes_total);
	if ( clip.bytes_loaded == clip.bytes_total ) {
		clearInterval(intervalname);
		trace(intervalname);
	}
}

container.loadMovie("catnap.jpg");

preloader = setInterval(queryload, 500, container, preloader);

```

The bytes\_loaded and bytes\_total information is being traced back correctly. However when I do a trace for the ‘preloader’ ID, it returns “undefined”.

I have a feeling that I am not identifying the preloader ID correctly when I clear it, or when I pass it to another function.

Any hints?
