set the loc of me to the mouseLoc ?

Marty Billingsley marty at vertex.ucls.uchicago.edu
Tue Mar 16 10:35:22 EST 2004


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.).
Make sure that the object is in the uppermost layer; if anything else is
sitting on top of it, the mouseDown message won't get through.

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

or, for a smoother drag:
on mouseDown
  grab me
end mouseDown

Hope this helps,
  - marty

--
Marty Billingsley (marty at ucls.uchicago.edu)
The University of Chicago Laboratory Schools

    "We are our choices...."
                   - Sartre


More information about the use-livecode mailing list