mouseLeave

Sent when the mouse pointer moves out of an object.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

mouseLeave

# Examples

on mouseLeave -- hide another object hide field "Comments" end mouseLeave

# Description

Handle the mouseLeave message to update a control when the mouse pointer moves outside it.

The mouseLeave message is sent only when the Browse tool is being used.

If two controls overlap, a mouseLeave message is sent whenever the mouse pointer crosses outside a visible portion of a control. The control on the bottom receives a mouseLeave message only when the mouse pointer leaves part of the control that can be seen. A control that is completely hidden by another control on top of it will never receive a mouseLeave message.

If the mouse button is down when the mouse pointer leaves the control, the mouseLeave message is sent once the mouse button has been released.

If a control is hidden (by changing its visible property to false or using the hide command), and the mouse pointer is over the control when it is hidden, LiveCode sends a mouseLeave message to the control.

>*Note:* Take care when using both mouseEnter and mouseLeave in the > same control that an unintentional infinite loop may be invoked. > To prevent a loop, use a condition in the mouseLeave message handler > to ensure the mouse pointer is still outside of the control or > in the mouseEnter message to check the mouse pointer is still inside > the control.

# Tags

ui,

# See

- **message:** mouseWithin, mouseEnter - **command:** focus, hide - **function:** mouseControl - **glossary:** property, Browse tool, mouse pointer, message, command, control, object, loop