package com.test{
import flash.display.Sprite;
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.easing.*;
import com.test.CreateRoundRectButton;
import flash.events.*;
import flash.net.*;
public class DetailView extends MovieClip {
private var detailPanel:MovieClip=new MovieClip();
private var detailData:Object;
private var closeBtn:Sprite;
private var DetailForm:DetailViewForm=new DetailViewForm();
public function DetailView() {
createPanel();
addChild(detailPanel)
detailPanel.addChild(DetailForm);
}
private function createPanel()
{
closeBtn=new CreateRoundRectButton(30,30,10,1,0xFFFFFF,"X",0x000000);
closeBtn.x=DetailForm.width - 25;
closeBtn.y=2;
closeBtn.addEventListener(MouseEvent.MOUSE_UP, closePanel,false,0,true);
DetailForm.addChild(closeBtn)
}
public function closePanel(evt:MouseEvent) {
removeChild(evt.currentTarget)
}
}
}
How can i remove the child of this class. when i press on the close button it needs to be remove the window. But am not getting this event properly. how can i remove this.