Showing/Hiding Images on mouseLeave...

Jan Schenkel janschenkel at yahoo.com
Thu Nov 14 02:15:01 EST 2002


--- Igor de Oliveira Couto <info at pixelmedia.com.au>
wrote:
>
> [snip]
> 
> All I can deduct is that for some reason, the first
> time the mouse 
> leaves the 'over' image, no 'mouseLeave' message is
> being sent to it! 
> Only after the cursor has re-entered the image, and
> then proceeds to 
> leave again, does it work...
> 
> Am I missing something embarrassingly simple? Did I
> not read the 
> documentation properly? Is this a behaviour that
> others have noticed? 
> Is it a bug?
> 
> Any help would be greatly appreciated!
> 
> Kind Regards,
> --
> Igor de Oliveira Couto
>

Hi Igor,

The reason seems quite simple: the "over" image never
got a 'mouseEnter' message at the time it was hidden,
and doesn't get one when it appears as the mouse was
already within its rect.
Applying Newton's action-reaction theorem to MC/RR,
the "over" message doesn't get a 'mouseLeave' either
as it didn't 'mouseEnter' it in the first place.

Easiest solution would be to stick with a 'one image,
many pictures' approach, and handle all the messages
from within a single object, setting the fileName to
the different states.

Or you could have it all handled with a single button,
no scripting required:
- import the graphics
- set its 'icon' to the "idle" graphic
- set its 'armedIcon' to the "over" graphic
- set its 'autoArm' property to true.

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com



More information about the use-livecode mailing list