Since you don't provide enough information to be sure this is what you need.... I'll assume you are creating a projector and have a button named btn1



Something like this
btn1.addEventListener(MouseEvent.CLCIK, closeHandler);

function closeHandler(Event){
fscommand("quit");
}