just create a button for that close and place this code

on (release) {
fscommand("quit");
}