Page 1 of 1

Mouse down hold so as to repeat handler...

Posted: Thu Sep 04, 2008 12:15 pm
by gyroscope
Hi, I've a problemette I can't solve:

Group of images + a button. Script for button:

Code: Select all

on mouseDown
    put the location of group id 1009 into tMoo
    put item 1 of tMoo into tMoveLR
    put item 2 of tMoo into tFix
    move group id 1009 to (tMoveLR + 88), tFix in 5 ticks  
end mouseDown
That's works fine but I would also want it that if the user holds down the mouse button for half a second or more, for it to continually move (with a very slight pause in between, each time, then stop nicely with a mouseUp). I would think that the mouse needs to be polled (is that the correct term?) and if it's being held down for more than half a second, the above code is run as a repeat loop, I guess.

But how to script that the user is holding the mouse down for half a second or more and so for the repeat loop to run?

Any answers to this appreciated, thanks.

:)

Posted: Thu Sep 04, 2008 4:10 pm
by gyroscope
Hi, just worked it out; seems to behave as I want.

I've used

Code: Select all

repeat while the mouse is down
before the code above, and

Code: Select all

wait 5 ticks
after.

If anyone knows any refinements I'd really like to read them, thanks!

:)