How to set a field in place with dragenter and a singleclick?

William de Smet wdesmet at wanadoo.nl
Sat Dec 17 12:44:26 EST 2005


Hi there,

For my first app I am looking for a function where a field would  
stick to the mouseloc after a mouseclick and on the next mouseclick  
to let the field go (I work with disabled children so need to make it  
as easy as possible!)
By accident (after playing with dragEnter) I got what I want but a  
little thing still bothers me: with the script I got so far I need to  
doubleclick to let the field go and put it in place. What I want is a  
singleclick to make this happen.
What do I need to do ?
Below the script I use:

Stackscript:
on dragEnter
end dragEnter

Fieldscript:
on mouseDown
   grab me
   set the layer of me to 100
   set cursor to 28
   lock cursor
   set the dragdata["text"] to the short name of the target
end mouseDown
on mouseup
   unlock cursor
   set cursor to arrow
end mouseup

Thanks,

William de Smet





More information about the use-livecode mailing list