mouseEnter/mouseLeave Problem

David Burgun dburgun at dsl.pipex.com
Wed Apr 13 10:53:32 EDT 2005


>Similar to what I put in another message that I just sent in...
>
>If you maintain a global variable to keep track of the graphic that is
>set to blue - then, whenever you set a new graphic to blue, you can make
>sure the previous graphic, whose name is stored in the global variable,
>gets set back to black.
>
>I believe that mouseleave is also not called while the button is still
>down. And now that I looked it up in the docs, even using mousecontrol
>will not work (as used in the suggested script I just sent), because
>that remains the original clicked control, even if you have moved over
>another object, until you release the mousebutton.
>
>You might have to resort to checking to see if the mouseloc is within
>the rect of each graphic you wish to check - ugh.


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???

Thanks a lot
Dave

>
>-----Original Message-----
>From: use-revolution-bounces at lists.runrev.com
>[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of David
>Burgun
>Sent: Wednesday, April 13, 2005 9:43 AM
>To: How to use Revolution
>Subject: RE: mouseEnter/mouseLeave Problem
>
>I don't think so, cos it's mouseLeave that isn't being called.
>
>If both rectangles are black and I move the mouse back and forth
>between them, all works as it should. If I mouseDown in either of the
>rectangles and then move the mouse to the other recangle, the
>Rectangle moved to changes to blue BUT the rectangle that has just
>been left DOES NOT get the mouseLeave message. Once this has happened
>once, the behaviour goes back to normal again, e.g. the rectangles
>change color and you would expect again!
>
>This really seems to be to do with interaction between mouseUp and/or
>mouseDown and maybe mouseStillDown. If anyone could shed some light
>on this I would be really gratefull I just can't seem to work out why
>this doesn't work???!!!
>
>Thanks in advance for any help
>Dave
>
>
>>Could it have to do with the fact that mouseenter is not sent if the
>>mouse button is already down when you enter an object?
>>
>>-----Original Message-----
>>From: use-revolution-bounces at lists.runrev.com
>>[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of David
>>Burgun
>>Sent: Wednesday, April 13, 2005 7:08 AM
>>To: How to use Revolution
>>Subject: mouseEnter/mouseLeave Problem
>>
>>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
>>
>>
>>_______________________________________________
>>use-revolution mailing list
>>use-revolution at lists.runrev.com
>>http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>>_______________________________________________
>>use-revolution mailing list
>>use-revolution at lists.runrev.com
>>http://lists.runrev.com/mailman/listinfo/use-revolution
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list