3 Replies Latest reply on Nov 2, 2006 12:06 PM by Chunick

    Mouse Idle?

    Dan Phillips
      I need some help figuring out what lingo I use to have an event happen once the mouse has been idle (no mouse clicks or movement) for a period of time.
        • 1. Re: Mouse Idle?
          otterman
          Try something like this - will look at mouse location (the MouseLoc) and start a timer. If your mouse moves it will restart the timer but if the timer is up, it will cause your event, ta-daaah!
          • 2. Re: Mouse Idle?
            Level 7
            You can use the lastRoll property. It will tell you how long it has
            been since the mouse was moved. This code (copied straight from the help
            file) will go to the "Attract Loop" frame after the mouse has not moved
            for 45 seconds.

            if (_player.lastRoll > (45 * 60)) then
            _movie.go("Attract Loop")
            end if

            There is also the lastEvent property which does the same thing but takes
            into consideration mouse and keyboard input.
            • 3. Re: Mouse Idle?
              Chunick Level 3
              you can test mouse clicks using the lastClick... for the mouse click... don't know if it works for both right and left buttons and/or any other buttons to be found on certain mice.

              There's also lastKey, lastEvent, and lastRoll (as mentioned already)