If you set _movie.exitLock=TRUE then a click on the close button, or Alt-F4, or Esc will all trigger a (movie script) handler named 'on closeRequest'. In this handler you can determine whether conditions have been met, post a (synchronous) dialog message, etc. Be careful to issue _player.quit() or halt() from somewhere within this #closeRequest handler or you'll have to force-kill the application.
closeRequest is an undocumented handler. Find more details here: CloseRequest - Director Online Wiki
Problem is that I'm trying to use this from a window and it closes the window, doesn't execute the "IF" anf leaves the player open in the background.
Well you did say 'projector'.
You can always issue _player.activeWindow.open() from within the #closeWindow handler if you really don't want the window closed. So re-open the window, present whatever (synchronous) prompt you want, then close it/forget it or leave it open based on any choices made by your user. You might see a flicker of the window, as it's closed and re-opened, but this is perhaps as good as you'll get.
Sorry about this. Yes, I did say 'projector'. My bad. I have a script that does exactly 'that'. Reopen the window with a flicker and it's exactly what I wanted to avoid.
It seems there's no other way out. I'll have to go back to what it was before.
Sean, I really appreciate your help. Thank you so much.