Posted: Fri Jan 16, 2015 5:53 am
I've got little fields with some text in them that the user can drag around. After the user is done dragging I want to update an array with the final location of the field. Usually, the script figures out that the user is done and updates the final location, but every now and then it doesn't. I've got every handler I can find that seems relevant set up to capture the event, but still sometimes none of these handlers gets a message.
I'm not confident that I'm able to consistently replicate the error. I'm using a touchpad and the field's lockText and opaque are set to true. Sometimes it seems like maybe the no-message problem is when the mouse isn't over the text; sometimes it seems like it's when I slide my finger just right as I'm releasing the mouse button. The BYU site said that touch messages are automatically converted to mouse messages, so maybe that's not a problem.
Code: Select all
on mouseMove newMouseX,newMouseY if the mouse is down then userDrag (the long name of me, newMouseX, newMouseY, the cNodeKey of me) end if end mouseMove on mouseUP userMoveNode (the cNodeKey of me, the loc of me) userFinishDrag end mouseUP on mouseRelease userMoveNode (the cNodeKey of me, the loc of me) end mouseRelease on mouseLeave if the mouse is down then userMoveNode (the cNodeKey of me, the loc of me) end if end mouseLeave