# Cannot debug error

**URL:** <https://forum.kirupa.com/t/cannot-debug-error/244961>\
**Category:** Uncategorized\
**Created:** [November 24, 2007, 4:32am UTC](https://forum.kirupa.com/t/cannot-debug-error/244961 "2007-11-24T04:32:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onecommoncode](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@onecommoncode](https://forum.kirupa.com/u/onecommoncode)\
**Post date:** [November 24, 2007, 4:32am UTC](https://forum.kirupa.com/t/cannot-debug-error/244961/1 "2007-11-24T04:32:18Z")

</div>

I am loading and array of images. The first image will show then I am getting an error that I cannot figure out what is causing the problem. Below is the error message and the method that is causing the error.

Thumb is the mc that I am attaching from my library. Thumb has a mc inside of that called GalleryHolder. I am then putting it into a scroller which works fine. I narrowed down the problem when I try:

thumb.GalleryHolder.addChild( target.content ); When I comment out this line, the error goes away but of course the images don’t show because its not adding.

Error:

```auto

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
	at flash.display::Loader/unload()
	at com.ash::Main/::onImageLoaded()

```

AS:

```auto

private function onImageLoaded( event:Event ):void
		{
			trace( "its working" );
			
			var target:LoaderInfo = LoaderInfo( event.currentTarget );
			
			var thumb:Thumb = new Thumb();
			
			_scroller.addChild( thumb );
			
			thumb.GalleryHolder.addChild( target.content );
			
			_thumbLoader.unload();
			
			onLoaderComplete();
		}

```
