Mouse Messages
Lingo generates messages that can be sent in response to some internal or external activity or script.

There are six different Lingo messages that relate to the mouse:

mouseDown
mouseUp
mouseUpOutside
mouseEnter
mouseWithin
mouseLeave
The mouse messages are sent in response to mouse activity.

mouseDown - This message means that the mouse button has been pressed down while the mouse pointer is within the sprite.

mouseUp - This message means the mouse button has been released, and the mouse pointer is within the sprite.

mouseUpOutside - This message means the mouse button has been released, and the mouse pointer has moved outside the boundaries of the sprite.

mouseEnter - This message means that the mouse pointer has entered the sprite.

mouseWithin - This message means that the mouse pointer is still in the sprite.

mouseLeave - This message means the mouse pointer has moved outside the boundaries of the sprite.

Here are sample scripts that demonstrate mouseDown, mouseUp and mouseStillDown. Create a cast member named "Demo 1"and try typing in the script. Click on the buttonand see what happens. Then change the script to use mouseEnter, mouseLeave and mouseWithin. Notice the change in the way the button responds.

on mouseDown
puppetSound "doorbell.aiff"
end mouseDown

on mouseStillDown

add 10 to message
end mouseStillDown
 
 
Here is a script that will demonstrate mouseEnter and mouseLeave. Create a new sprite named "Demo 2." Type this script into the cast member script and click the sprite:
on mouseEnter
beep 3
end mouseEnter

on mouseLeave

beep 2
end mouseLeave

 

Programming for Interactive Mulitmedia I Home