User Guide
Navigation and User Interaction 377
Detecting mouse clicks with Lingo
Users can click the mouse button in several ways, each of which Lingo can detect. The following
are ways that you can use Lingo to detect what the user does with the mouse. See individual
properties and functions in the Lingo Dictionary.
• To determine the last place the mouse was clicked, use the clickLoc() function.
• To determine the last active sprite (a sprite with a script attached) that the user clicked, use the
clickOn function.
• To determine whether the last two clicks were a double-click, use the doubleClick function.
• To determine the time since the mouse was last clicked, use the lastClick() function.
• To determine whether the mouse button is pressed, check the mouseDown property.
• To determine whether the mouse button is released, check the mouseUp property.
• To determine whether the user presses the right mouse button (Windows) or Control+click
(Macintosh), check the
rightMouseDown property.
• To determine whether the user releases the right mouse button (Windows) or Control+click
(Macintosh), check the
rightMouseUp property.
For example, this handler checks whether the user double-clicked the mouse button and, if so,
runs the
openWindow handler:
on mouseDown
if the doubleClick = TRUE then openWindow
end
Making sprites editable and draggable
Using the Property inspector, you can make a sprite editable, draggable, or both while your movie
is running. See “Displaying and editing sprite properties in the Property inspector” on page 162.
To make a sprite draggable on the Stage:
• Click the Moveable button in the Property inspector.