6 Replies Latest reply on Nov 3, 2008 6:39 AM by Minds Eye

    How to close a projector when exit lock is true

    Minds Eye Level 1
      I want to trap the event when the user clicks the close box in the title bar of a projector e.g:
      on closeWindow
      alert("goodbye")
      end
      This works fine. However, I don't want the program bombing out when the user accidentally presses the Esc. key.
      So I set the exit lock to true. But then the close button no longer works.

      Is there any way around this?

      Regards,
      Trevor
        • 2. Re: How to close a projector when exit lock is true
          Minds Eye Level 1
          Thanks for the response. I already know commands to exit from the program.
          What I'm looking for is how to trap when the user clicks on the close button of the title bar.
          • 3. Re: How to close a projector when exit lock is true
            Level 7
            There's a Windows-only xtra called QuitMsg that will notify of a click
            on the Close box.
            You could also try fooling with the undocumented "on closeRequest"
            handler and check for keys pressed when it fires to see if it's an
            Alt+F4 or Esc key that's requesting the application to close.
            • 4. Re: How to close a projector when exit lock is true
              dc_mccarron
              Hi Mind's Eye

              I am working on a full-screen program which I do not want the end user to be able to exit the application but I need the ability as the programmer to exit the application when necessary. I had some help from Mike Blaustein. To do this I placed an image (button) throughout the movie and made it transparent. I then used a script to tell the program to exit.

              on mouseUp me
              quit
              end

              This works fine until you press the invisible button by mistake. To fix that, I added another part of script to allow the program to exit only when the invisible button is clicked ALONG WITH the shift key being pressed:

              on MouseUp me
              if the shiftDown then quit
              end

              If it's still possible that the user of your movie will hold Shift and click the button, try swapping out shift for another key or a combination of keys. HTH.

              • 5. Re: How to close a projector when exit lock is true
                Level 7
                What I do is grab the screen when the projector is open, edite that graphic
                and recreate the title bar in the movie. Then set the actual title bar off.
                Then I can do whatever I want with the X box. One of the many advantages
                beyond what you want to do is that you can add custom messages to the bar in
                any format rather than just having the projector name there. For that
                matter you could create a custom bar that doesn't look like the standard
                Windows choices.

                Craig

                "The Minds Eye" <webforumsuser@macromedia.com> wrote in message
                news:gecmp2$cmq$1@forums.macromedia.com...
                >I want to trap the event when the user clicks the close box in the title
                >bar of
                > a projector e.g:
                > on closeWindow
                > alert("goodbye")
                > end
                > This works fine. However, I don't want the program bombing out when the
                > user
                > accidentally presses the Esc. key.
                > So I set the exit lock to true. But then the close button no longer works.
                >
                > Is there any way around this?
                >
                > Regards,
                > Trevor
                >
                >


                • 6. Re: How to close a projector when exit lock is true
                  Minds Eye Level 1
                  Hi everyone,
                  Thanks for your responses.
                  In most previous projects I've created my own titlebar. But in this one I particularly wanted to use the Windows interface titlebar but also want the exitLock on.
                  Sean's command "on closeRequest" was just the handler I was looking for.
                  It gets called when the user clicks on the close button and when the user presses escape. Perfect!

                  Many thanks,
                  Trevor