5 Replies Latest reply on Jun 12, 2006 4:24 PM by Newsgroup_User

    the projector doesn't quit when pressing a key

    Angelo Trani
      hello, i made a little projector of a slideshow, so no buttons, no difficult things... only, i set it to loop, and put a behaviour on every frame that, on mouse down or key down it has to exit. but id doesn't exit, no way.
      Can anyone help me? Thanks.
        • 1. Re: the projector doesn't quit when pressing a key
          Level 7
          On Sun, 11 Jun 2006 16:27:14 GMT, il mago posted in
          macromedia.director.basics:

          > hello, i made a little projector of a slideshow, so no buttons, no
          > difficult things... only, i set it to loop, and put a behaviour on every
          > frame that, on mouse down or key down it has to exit. but id doesn't
          > exit, no way.
          >
          > Can anyone help me? Thanks.

          I'm sure we can if you share some information. Care to show your code?

          keyDown events are not trapped by behaviors in the behavior script channel.
          When on keyDown is in a behavior, only sprites with text or field members
          will trap the event. Here's one possible scenario that should work.

          -- Movie script (not placed anywhere in the score)
          on startMovie
          the keyDownScript = "halt"
          end

          on mouseDown
          halt
          end

          -- behavior script on last frame
          on exitFrame me
          go 1 -- or whatever your "loop" is
          end


          --
          Mark A. Boyd
          Keep-On-Learnin' :)
          • 2. Re: the projector doesn't quit when pressing a key
            Angelo Trani Level 1
            Hello, thanks for the answer.
            Everything ok for the loop, but nothing for the exit on key or mouse click.
            I tried as you said (made a movie script, now is in the cast, but do i have to put it anywhere, or it just works automatically?), and i also tried scripting like this:
            on startMovie
            on keyDown
            halt
            end

            on mouseDown
            halt
            end

            and nothing: when i click with mouse or enter some key the projector starts from the beginning.

            Just don't know what to do...
            • 3. Re: the projector doesn't quit when pressing a key
              Level 7
              On Sun, 11 Jun 2006 23:43:09 GMT, il mago posted in
              macromedia.director.basics:

              > Hello, thanks for the answer.
              > Everything ok for the loop, but nothing for the exit on key or mouse
              > click. I tried as you said (made a movie script, now is in the cast,
              > but do i have to
              > put it anywhere, or it just works automatically?),

              As long as it really is a movie script, it should work automatically. This
              works, too:

              on mouseDown
              halt
              end

              on keyDown
              halt
              end

              I tested both this and my previous post in a projector. You might try
              replacing halt with quit, but it will quit Director in authoring mode,
              too.

              and i also tried
              > scripting like this:
              > on startMovie
              > on keyDown
              > halt
              > end
              >
              > on mouseDown
              > halt
              > end

              I don't know what to expect here. You shouldn't nest handlers within
              handlers in Director.

              > and nothing: when i click with mouse or enter some key the projector
              > starts from the beginning.

              Do you still have some other behaviors that may be trapping those events
              before the movie script? Try creating a simple test movie. If it works
              there, see what's different in your actual movie.


              --
              Mark A. Boyd
              Keep-On-Learnin' :)
              • 4. Re: the projector doesn't quit when pressing a key
                Angelo Trani Level 1
                Thanks Mark, i probably made some mess with the scripts. Just cleaned it all, inserted the last you told me and everything is ok.
                Bye.
                • 5. Re: the projector doesn't quit when pressing a key
                  Level 7
                  On Mon, 12 Jun 2006 18:25:55 GMT, il mago posted in
                  macromedia.director.basics:

                  > Thanks Mark, i probably made some mess with the scripts.

                  :) I just went through something similar in my project. Good thing I keep
                  backups!

                  > Just cleaned it all, inserted the last you told me and everything is ok.

                  Glad to hear it.


                  --
                  Mark A. Boyd
                  Keep-On-Learnin' :)