5 Replies Latest reply on Dec 14, 2006 2:55 AM by mirianam

    determining the preceeding mouseclick

    mirianam Level 1
      On the stage I have 5 menu buttons which go to different movies.
      In this particular instance, when the used clicks on one of these buttons instead of going straight to the new movies, there should be a "dialog" asking the user if they are really sure that they want to go. So in this "dialog" there are 2 buttons.
      The first button "I'll stay here" closes the dialog and the video continues. This part I can do OK.

      The second button "I really want to go elsewhere" should close the dialog box and then navigate to the movie of the menu button. This part I don't know where to start - how to store the previous clickOn? or what?

      Thank you
        • 1. Re: determining the preceeding mouseclick
          Level 7
          If I'm understanding your question correctly, just have the first click
          save a variable. Something like:

          The first button:
          on mouseUp me
          MarkerToJumpTo = "Chapter2"
          sprite("2ndChoices").visible = true -- or however you're showing
          your 2nd set of buttons
          end

          Then the 2nd button:
          on mouseUp me
          go to frame "MarkerToJumpTo"
          sprite(the currrentSpriteNum).visible = false
          end

          . . .Something like that should work
          • 2. Re: determining the preceeding mouseclick
            mirianam Level 1
            Thank you but I don't think I explained my problem very well.
            Or perhaps I am not understanding your suggestion. Sorry.

            On the stage I have 5 navigation buttons - "Main", "What to Take", "Right Spot", "Right Conditions", "More Info". Throughout the rest of the project, when the user clicks on eg "Main" the projector will go the movie "Main", when they click on "More Info" the projector will go to movie "More Info" etc. Pretty standard stuff.

            In this particular section, it is important that the user stays and watches the video that is playing for the full length (20 seconds). So here, when the user clicks on eg "Main" instead of going directly to "Main" movie there will be an alert/dialog box asking if they really want to go away before they have seen the full length of the video.

            In this dialog box there will be 2 buttons, one to go back to the current movie and continue watching the video and the 2nd button to go to whatever movie that the button they click on (before the dialog box) usually went to.

            It is this second button (in the dialog box) that I am not sure how to do this - if they clicked on the "Main" button before the dialog then they should continue to "Main" movie but if they had clicked on eg "More Info" then they should continue to "More Info" movie etc
            • 3. Re: determining the preceeding mouseclick
              Level 7
              When you show these new buttons instead of moving to the new movie, you
              need to store the value of the user's selection. If you create a
              property variable in the behavior attached to the buttons, then store
              the movie name in that variable, you can then refer back to that
              variable from your second button.

              --
              Rob
              _______
              Rob Dillon
              Adobe Community Expert
              http://www.ddg-designs.com
              412-243-9119

              http://www.macromedia.com/software/trial/
              • 4. Re: determining the preceeding mouseclick
                Level 7
                On Wed, 13 Dec 2006 06:04:33 GMT, mirianam posted in
                macromedia.director.lingo:

                > It is this second button (in the dialog box) that I am not sure how to
                > do this - if they clicked on the "Main" button before the dialog then
                > they should continue to "Main" movie but if they had clicked on eg
                > "More Info" then they should continue to "More Info" movie etc

                How are you creating this dialog box? Director sprites, MUI Xtra, Buddy
                Api, other?

                If they're sprites, what method are you using to display the dialog box
                sprites? Can you send a parameter to those sprites?

                Some pseudocode to illustrate (this may be similar to what Rob meant):

                -- "Main" button
                on mouseUp me
                if video is still playing then
                sendAllSprites(#mShowDialog, "Main")
                else
                go to movie "Main"
                end if
                end

                -- "I really want to go elsewhere" button
                property pGoTo
                on mShowDialog me, whereToGo
                -- what ever code you use to show this sprite, then:
                pGoTo = whereToGo -- store the destination in a variable
                end

                on mouseUp me
                go to movie pGoTo
                end



                --
                Mark A. Boyd
                Keep-On-Learnin' :)
                • 5. Re: determining the preceeding mouseclick
                  mirianam Level 1
                  Thank you very much - what you say makes sense - but under pressure of Xmas deadlines - At the moment I have a clumsy solution which is working - the 2nd button sprite duplicated 5 times - with a go to movie handler.

                  BTW I hope you have a very good Xmas and hope you can put a "Closed for Holiday" sign up on your door.
                  Cheers

                  PS Really thank you to everyone how has been so helpful with all my questions