Cop a load of this:

put this script in "Button":

on mouseDown
  grab me
end mouseDown

on mouseStillDown
  put the mouseLoc into VL1
  set the loc of me to VL1
  put the loc of btn "Button" into line 1 of fld "VL"
  put the loc of btn "Button1" into line 2 of fld "VL"
  set the points of graphic "line" to fld "VL"
end mouseStillDown

on mouseUp
  put the mouseLoc into VL1
  set the loc of me to VL1
  put the loc of btn "Button" into line 1 of fld "VL"
  put the loc of btn "Button1" into line 2 of fld "VL"
  set the points of graphic "line" to fld "VL"
end mouseUp

and, surprise, surprise, this script in "Button1":

on mouseDown
  grab me
end mouseDown

on mouseStillDown
  put the mouseLoc into VL2
  set the loc of me to VL2
  put the loc of btn "Button" into line 1 of fld "VL"
  put the loc of btn "Button1" into line 2 of fld "VL"
  set the points of graphic "line" to fld "VL"
end mouseStillDown

on mouseUp
  put the mouseLoc into VL2
  set the loc of me to VL2
  put the loc of btn "Button" into line 1 of fld "VL"
  put the loc of btn "Button1" into line 2 of fld "VL"
  set the points of graphic "line" to fld "VL"
end mouseUp

Still fairly clunky, but a lot better than my first effort. The secret lies in the 'mouseStillDown' thing .. . :)

Richmond.

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to