MovieClip.AddChild() needs your help

Hello everyone.

Think I need help from all the wise developers here on Kirupa. I’m trying to do something similar to JS LightBox. But I hit the wall and cant fix it.

So, basically I’m creating an empty movieClip/Sprite on stage using AS3. Give it fill, draw a rectangle in it, x, y coordinates, adding to stage, so far so perfect, it appears where it has to.
Then, there is also another MC with ButtonMode=true. Will be the trigger.
I’ve added listener to the buttonMC to catch the MouseDown Event. Works.

But what happens there it just doesn’t make sense.

here’s some code:


function fireLightee(e:MouseEvent):void{//from mc-button eventListener
	
	var loader = new Loader();  
	 
	loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoad);  
	
	loader.load(new URLRequest("img/S6301331.jpg")); 
	
}

function onImageLoad(e:Event):void {  
    
    var loader:Loader = e.target.loader;  
    loader.x=0;
    loader.y=0;
      
    pic_mc.addChild(loader.content);  
    trace("Loading Completed");
}  


All I get is some nasty blue 10px wide row just next to the pic_mc. Where does the picture hide?

It should work, Am I missing something?

My config: iMacG5, 10.5.8, Fl_CS4.

Thanks for any help.

Barts