6 Replies Latest reply on Jan 29, 2008 11:18 AM by Newsgroup_User

    closeRequest event

    Level 7
      Hi

      How can closeRequest event be called from Director environment
      I need to test its functionality in debugger but do not now how can I run
      director into tha code of the event
      on closeRequest
      ......
      end closeRequst

      In projector I press Alt+F4 or klick close button on titlebar, but in
      aothoringmode both ways do not work

      Any help will be appreciated
      game_dev


        • 1. Re: closeRequest event
          robdillon Most Valuable Participant
          CloseRequest only runs from a projector or sw file, so you'll have to test from the projector or shockwave.
          • 2. URGENT: closeRequest event
            Level 7

            Is it possible which key or which control has caused this event?

            I have to define if ESC was pressed or ALT+F4 - how can this be done?


            "Rob Dillon" <rob@ddg-designs.com> wrote in message
            news:fnkqq4$6c7$1@forums.macromedia.com...
            > CloseRequest only runs from a projector or sw file, so you'll have to test
            > from the projector or shockwave.


            • 3. Re: URGENT: closeRequest event
              Level 7
              > I have to define if ESC was pressed or ALT+F4 - how can this be done?

              Check 'the key', or 'the keyCode'
              • 4. Re: URGENT: closeRequest event
                Level 7
                It doesnt work
                For example, If I use following code as moviescript (my dir has nothing else
                in it)
                on startMovie

                the keydownScript="KeyDownEvent"

                end

                on closeRequest

                alert "caught Close Request"&&string(the keycode)

                end

                on KeyDownEvent

                alert "KeyDownEvent"&&string(the keycode)

                end

                Then I create a projector and start it and press ESC the result is:
                1) Alert with text "caught Close Request 0"
                1) Alert with text "KeyDownEvent 53"

                O next ESC I get:
                1) Alert with text "caught Close Request 53"
                1) Alert with text "KeyDownEvent 53"

                Also when I press closebutton on Titlebar after pressing ESC before I get
                Alert with text "caught Close Request 53"

                So I can not define which control has called closeRequestEvent.
                Can this be done in any way?

                IT's VERY URGENT, the project has passed all deadlines :-((
                Any help will be appreciated

                "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
                news:fnlb9u$oi9$1@forums.macromedia.com...
                >> I have to define if ESC was pressed or ALT+F4 - how can this be done?
                >
                > Check 'the key', or 'the keyCode'


                • 5. Re: URGENT: closeRequest event
                  Level 7
                  Try something like:
                  on closeRequest
                  if _key.keyPressed(53) then
                  -- ESC
                  alert "ESC"
                  else if ( _key.keyPressed(118) AND the optionDown ) then
                  -- Alt+F4
                  alert "Alt+F4"
                  end if
                  -- return 0
                  end
                  • 6. Re: URGENT: closeRequest event
                    Level 7
                    Also, perhaps you could explain why you need to differentiate how your
                    projector is being quit?