mouseEnter/mouseLeave Problem

David Burgun dburgun at dsl.pipex.com
Wed Apr 13 11:24:58 EDT 2005


>You might have to resort to checking to see if the mouseloc is within
>the rect of each graphic you wish to check - ugh.

Ok, I finally got the expect results by doing the following!!!!!!!!

on mouseEnter
put the name of the last graphic into myGraphicName
if myGraphicName <> name of me then
  set the foregroundColor of graphic myGraphicName to black
end if

set the foregroundColor of me to blue
end mouseEnter

on mouseDown
put the name of the last graphic into myGraphicName
set layer of me to top

if myGraphicName <> name of me then
  set the foregroundColor of graphic myGraphicName to black
end if

end mouseDown

And this works!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Hope this is of help to someone at some stage!!!
Dave

-----------------------------
But I *DO* release the mouse button! I have two overlapping 
rectangles, A and B:

A is in front of B - both are black, mouse is outside both of them.
(user moves mouse into either A or B and the color changes to blue)
(user moves outside of both and they both go black)
(user moves back and forth between A and B and they change color correctly)
(user does a mouseDown and mouseUp in side the one that is already at 
the Front (A in this case))
(user moves mouse back and forth between A and B and they change 
color correctly)
(user does a mouseDown on the rectangle that is behind (B in this case))
(Both rectangles turn blue - B is placed in front of A)
(Move back and forth twice and all is back to normal and A and B 
change as expected)

So, I tried doing this:

on mouseDown

put name of last graphic into myGraphicName
set the foreGroundColor of graphic myGraphicName to black
set layer of me to top

end mouseDown

And it STILL doesn't work!!!!!!!!!!!!!!!!!

I have also tried sending an "mouseLeave" event to the "last" graphic 
and this doesn't work either!

Could someone explain to me why this doesn't work???


More information about the use-livecode mailing list