set the loc of me to the mouseLoc ?

Ken Norris pixelbird at interisland.net
Tue Mar 16 18:24:00 EST 2004


Hello folks,

> Date: Tue, 16 Mar 2004 09:35:22 -0600 (CST)
> From: Marty Billingsley <marty at vertex.ucls.uchicago.edu>
> Subject: RE: set the loc of me to the mouseLoc ?
> 
> Erik Hansen writes:
> 
>> this did not work for me.
>> 
>> on mouseDown
>> set the loc of me to the mouseLoc
>> end MouseDown
> 
> This should work for just about any object (button, image, graphic, etc.).
------------
Works for me too, unless the message path is being cut off or intercepted.
Of course the object may not move very far, depending how close it's loc is
to the mouse when you click, i.e., if you happen to click at the object's
center, nothing will happen.
------------
> If you want the user to be able to drag the object, try:
> on mouseStillDown
> set the loc of me to the mouseLoc
> end mouseStillDown
-------------
If you need a constrained grab, let me know, I have scripts that use the
mouseMove message that will do it very efficiently with very little taxing
of the processor as compared to mouse-polling scripts, which hog the
processsor; sometimes it doesn't matter, but it if you have any processing
going on in the background, it can cause mouse-polling to fail.

HTH,
Ken N.



More information about the use-livecode mailing list