User Guide
186 Chapter 10: Events and Messages
Example
This handler, assigned to sprite 10, switches the cast member assigned to sprite 10 when the user
releases the mouse button after clicking the sprite:
-- Lingo syntax
on mouseUp
sprite(10).member = member("Dimmed")
end
// JavaScript syntax
function mouseUp() {
sprite(10).member = member("Dimmed");
}
See also
on mouseDown (event handler)
on mouseUpOutside
Usage
-- Lingo syntax
on mouseUpOutside me
statement(s)
end
// JavaScript syntax
function mouseUpOutside() {
statement(s);
}
Description
System message and event handler; sent when the user presses the mouse button on a sprite but
releases it (away from) the sprite.
Example
This statement plays a sound when the user clicks the mouse button over a sprite and then
releases it outside the bounding rectangle of the sprite:
-- Lingo syntax
on mouseUpOutside me
sound(1).play(member("Professor Long Hair"))
end
// JavaScript syntax
function mouseUpOutside() {
sound(1).play(member("Professor Long Hair"));
}
See also
on mouseEnter, on mouseLeave, on mouseWithin