how to combine mouseEnter & mouse is Down?
devin_asay at byu.edu
Tue Oct 22 11:42:54 EDT 2013
On Oct 22, 2013, at 7:00 AM, Tiemo Hollmann TB wrote:
> I want to fire an action, when the mouse is entering an image, while the
> mouse is down. The problem is, that I don't get the message "mouseEnter"
> while the mouse is down.
> I could work around with mouseMove and testing the mouseloc within the rect
> of the image, but I wonder, if there is a more straight forward solution?
As you said, most mouse messages are not sent while the mouse is down. But mouseMove is. When I need to do things like this I just use 'is within' or 'within()' inside a mouseMove handler. The main drawback is you have to check for every potential target inside your mouseMove handler. On the other hand, you can limit the targets to only the objects you are interested in. Here's an example I've used for dragging an object to various 'hot spots'.
grab the target
if the mouseLoc is within the rect of image "myimg" then -- or any object
# do stuff here
Learn to code with LiveCode University
More information about the Use-livecode