Page 1 of 1

MouseLeave on group doesn't work...

Posted: Tue Oct 14, 2008 9:48 pm
by gyroscope
Hi, I've three buttons, grouped, and the code for the group:

Code: Select all

on mouseLeave
    put "now " after field "Bn" ---this is just a test to show that mouseLeave is activated
    --when leaving any one of the three buttons, not the group, as wanted
    set the visible of me to false
end mouseLeave
And as described above, the mouseWithin message is sent when the mouse leaves any of the three buttons, rather than when it leaves the group.

A bit confuddled here; has anyone any ideas what I'm doing wrong here please?

Posted: Tue Oct 14, 2008 10:43 pm
by BvG
Groups are "special", some kind of a vitual object if you want so. They do not receive many messages, but instead the containing objects will get those messages in most cases. So you need a workaround if you're just interested in a invisible rectangle's messages. For example a rectangle graphic which has the same colour as the background of your final stack, or some trickery with the blendlevel and ink. Images that contain a transparent pixel are also nice for these things.

Posted: Tue Oct 14, 2008 11:19 pm
by gyroscope
Thanks for that info, BvG. I'll try an image or even a text box and set the disabled to true, or a transparent image as per your suggestion and see if I can get any joy there; or just had a thought, make it one button, which looks like three, with separate code depending on which third of the button the mouse is pressed.

:)