# Error when trying to remove ProgressEvent listener

**URL:** https://forum.kirupa.com/t/error-when-trying-to-remove-progressevent-listener/289338
**Category:** Uncategorized
**Created:** [May 29, 2009, 3:56am UTC](https://forum.kirupa.com/t/error-when-trying-to-remove-progressevent-listener/289338 "2009-05-29T03:56:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![quicksmack](https://avatars.discourse-cdn.com/v4/letter/q/fbc32d/32.png) [@quicksmack](https://forum.kirupa.com/u/quicksmack)
#### Post date: [May 29, 2009, 3:56am UTC](https://forum.kirupa.com/t/error-when-trying-to-remove-progressevent-listener/289338/1 "2009-05-29T03:56:31Z")

</div>

why does flash return an error (Error #2099: The loading object is not sufficiently loaded to provide this information.) when i try to remove the PROGRESS event listener?

```auto
var thumbLoader:Loader;
createThumbnails();

function createThumbnails():void
{
thumbLoader = new Loader();
thumbLoader.load(new URLRequest(thumbsXMLList*.attribute("source")));
addChild(thumbLoader);
thumbLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, defineBytesCount);
}

function defineBytesCount(evt:ProgressEvent):void
{
trace(evt.currentTarget.bytesTotal;
thumbLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, defineBytesCount); // commenting this out wont return any errors
}

```

i am using the ProgressEvent listener just so i can get the bytesTotal… after getting the bytesTotal, i need to remove the ProgressEvent Listener because i only need the defineBytesCount function to run once…
