loader unload event not calling
hi friends
my code is
try {
if (MovieClip(this.parent)!=null) {
if (MovieClip(this.parent).imagename!=null) {
var t=MovieClip(this.parent).imagename;
var url:URLRequest=new URLRequest(t);
var ldr:Loader = new Loader();
ldr.load(url);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadingComplete);
ldr.contentLoaderInfo.addEventListener(Event.UNLOAD, unloadimages);
imgholder.addChild(ldr)
function onLoadingComplete(e:Event):void {
var targetLoader:Loader=Loader(e.target.loader);
targetLoader.content.height=140;
targetLoader.content.width=180;
dispatchEvent(e);
}
function unloadimages(event:Event):void {
for (var childcounter:uint = 0; childcounter < imgholder.numChildren; childcounter++) {
var object:Object=imgholder.getChildAt(childcounter);
imgholder.removeChildAt(childcounter);
}
//while (imgholder.numChildren > 0){ imgholder.removeChildAt(0);}
ldr.contentLoaderInfo.removeEventListener(Event.UNLOAD, unloadimages);
imgholder.removeChild(ldr);
ldr.unload();
ldr=null;
}
}
}
} catch (e:Error) {
trace(" Load Big Image " + e);
}
my loder unload event not calling>>??