2 Replies Latest reply on Jan 28, 2008 2:13 PM by Newsgroup_User

    detecting two  seconds on mousedown

    Level 7
      Hello:

      Can you help detecting when a mousedown has passed two seconds to show a
      menu.?
      Any sample please.

      Thank you


        • 1. Re: detecting two  seconds on mousedown
          budgiebird Level 1
          Hi Arielle
          Sorry no script, but here is what I would do.
          Create a text field called, timerField.
          On mousedown
          Put 1 into timer

          In the global script write
          If timerField = 1 then
          And start the timer script.
          When the timer script = 2 seconds then make the menu visible or go to it, don’t forget to put 0 into timerField at this point to stop the timer script. Also put 0 into timerField on mouseup should the user decide not to access the menu.

          I’m sure someone else will provide a more elegant way, but this will work.

          Ron
          • 2. Re: detecting two  seconds on mousedown
            Level 7
            property pTime

            on mouseDown me
            pTime=the milliseconds
            end

            on enterFrame me
            if voidP(pTime) then pass

            if the milliseconds-pTime>2000 then
            alert "2 seconds have elapsed"
            pTime=void
            end if

            end