mouseEnter/mouseLeave Problem

David Burgun dburgun at dsl.pipex.com
Wed Apr 13 07:07:47 EDT 2005


Hi,

I have a script on a graphic rectangle object that does the following:

on mouseEnter
set foregroundColor of me to blue
pass mouseEnter
end mouseEnter

on mouseLeave
set foregroundColor of me to black
pass mouseLeave
end mouseLeave

on mouseDown
set the layer of me to top
end mouseDown

on mouseStillDown
-- Move the object via the mouse, sets a new rect for the object 
based on mouse movement
end mouseStillDown

This works fine most of the time, however if I have two rectangle 
that overlap each other on the display, then when I move the mouse 
from one to the other, the mouseLeave handler does not seem to get 
called ***IF* I have moused-down in one of these objects. For 
instance:

Both rectangles are set to black
I move the mouse into into Rectangle A which is in front of Rectangle 
B. Everything works ok. The rectangles change from black to blue as 
expected. However if I do this:

Both rectangles are set to black
Move into Rectangle A - Changes to Blue
Move into Rectangle B - A changes to Black and B changes to Blue (but 
B says behind A)
MouseDown in Rectangle B - B moves in in front of A
MouseUp in Rectangle B - (mouseStillDown may have been called)
(Now Rectangle B is in Front and set to Blue, rectangle A is black)
Move into Rectangle A - B does NOT go to black, the mouseLeave 
handler is NOT called, A gets changed to Blue, so both are set to 
Blue!!!

Any ideas why mouseLeave is not being called? Seems to be after a 
MouseDown/Up sequence?

Thanks a lot
Dave




More information about the use-livecode mailing list