How to lock a field after a drag?

William de Smet wdesmet at wanadoo.nl
Tue Nov 15 15:16:55 EST 2005


Hi there,

As a newbie I'm trying to do the following with a field:
drag field "1"  onto  field "2" and then count 1 up in a field   
called "score"  (field "1" must then be locked  until field " score"  
is five and next  field "1"  must be  draggable again.

So far I use the following code:
---------------------------------------------
on mouseDown
   grab me
   set cursor to 28
   lock cursor
   end mouseDown

on mouseup
   unlock cursor
   set cursor to arrow
if intersect(me,field "2") then
  move me to the loc of field "2"
  add 1 to field  "score"
end if
end mouseup
---------------------------------------------

I thought I use 'set mousedown on me to false'  after " add 1 to  
field "score" but that doesn't work because I can still drag the field
I need help, anyone?


Thanks, William de Smet


More information about the use-livecode mailing list