initialize="init(event)">
import mx.controls.Alert;
import flash.events.MouseEvent;
import flash.events.Event;
public function init(e:Event):void {
tw1.addEventListener(Event.CLOSE,closeWindow);
}
public function closeWindow(e:Event):void {
p1.removeChild(tw1);
}