How to limit a draggable image to a certain area?
William de Smet
wdesmet at wanadoo.nl
Wed Feb 1 09:57:44 EST 2006
Hi there,
It's been a while but I've got another question now:
In my app children can drag fields onto another field and see a reward.
But while testing someone told me that the image could be dragged out
of the main window and wasn't visible anymore.
So my question here: how can I limit the draggable area so the image
cannot be dragged out of the main window again?
TIA,
William de Smet
The code I use so far:
on mouseDown
grab me
set the layer of me to 100
set cursor to 28
lock cursor
end mouseDown
on mouseup
unlock cursor
set cursor to arrow
if intersect(me,field "Woord11") then
move me to the loc of field "Woord11"
play audioclip "pop.aiff"
add 1 to field "score2"
end if
send mouseup to button "check"
end mouseup
More information about the use-livecode
mailing list