# Strange Loader- Addchild problem

**URL:** <https://forum.kirupa.com/t/strange-loader-addchild-problem/321441>\
**Category:** flash\
**Created:** [April 19, 2011, 8:15pm UTC](https://forum.kirupa.com/t/strange-loader-addchild-problem/321441 "2011-04-19T20:15:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeccuk2005](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mikeccuk2005](https://forum.kirupa.com/u/mikeccuk2005)\
**Post date:** [April 19, 2011, 8:15pm UTC](https://forum.kirupa.com/t/strange-loader-addchild-problem/321441/1 "2011-04-19T20:15:09Z")

</div>

I had a working normal time line code:  
//var ldr:Loader=new Loader;  
[//ldr.load](https://ldr.load)(new URLRequest(“library/dummy.swf”));  
//addChild(ldr);

which works fine and loaded the image, however when I make a class file out of it it never load the image.  
The trace in the class did indicate that it was running \>start drawing

If anyone knows why, please tell me.

Timeline:

```auto

import com.razeoriginsdev.char_controller.*
var newchar:char_draw_bak=new char_draw_bak();

```

The char\_draw\_bak class:

```auto
package com.razeoriginsdev.char_controller{
	import flash.display.Stage;
	import flash.display.*;
	import flash.net.URLRequest;
	import flash.events.Event;

	public class char_draw_bak extends Sprite {//draw a char, simple function

		static public var ldr:Loader=new Loader ;

		//constructor//
		public function char_draw_bak() {

			trace("start drawing");
			char_draw_bak.ldr.load(new URLRequest("library/dummy.swf"));
			char_draw_bak.ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,onCompleteHandler);
			
		}
		public function onCompleteHandler(loadEvent:Event) {
			addChild(char_draw_bak.ldr);
		}
	}

}

```
