STOP drag me ?
Posted: Thu Mar 04, 2010 9:40 pm
How do I make a picture "lock" into position in this script?
(I want to move the picture to the correct position and if that is true then Lock it (stop drag me command
) (the red commented script)
Thanks! Ben
SCRIPT:
global my_old_position
on mouseDown
set the layer of me to the num of controls
put the loc of me into my_old_position
grab me
end mouseDown
on mouseUp
if within (img "Yellow" ,the loc of me) then
add 1 to field "Answer"
##set the dragMove to false
else
move me to my_old_position
subtract 1 from field "Answer"
end if
end mouseUp
(I want to move the picture to the correct position and if that is true then Lock it (stop drag me command
) (the red commented script)
Thanks! Ben
SCRIPT:
global my_old_position
on mouseDown
set the layer of me to the num of controls
put the loc of me into my_old_position
grab me
end mouseDown
on mouseUp
if within (img "Yellow" ,the loc of me) then
add 1 to field "Answer"
##set the dragMove to false
else
move me to my_old_position
subtract 1 from field "Answer"
end if
end mouseUp