4 Replies Latest reply on Jun 19, 2017 8:17 PM by BrianLucas

    Close Button...

    BrianLucas Level 1

      Hi guys,

      Quick question. Is there a way to have the close button not to close the projector IF doesn't meet certain criteria?

      Any light on these will be appreciated.

      Thanks

       

      Brian

        • 1. Re: Close Button...
          Sean_Wilson Adobe Community Professional

          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

          • 2. Re: Close Button...
            BrianLucas Level 1

            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.

            • 3. Re: Close Button...
              Sean_Wilson Adobe Community Professional

              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.

              • 4. Re: Close Button...
                BrianLucas Level 1

                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.