184
Chapter 10: Events and Messages
on mouseLeave
Usage
-- Lingo syntax
on mouseLeave
statement
(
s
)
end
// JavaScript syntax
function mouseLeave() {
statement
(
s
);
}
Description
System message and event handler; contains statements that run when the mouse leaves the active
area of the sprite. The mouse button does not have to be pressed.
If the sprite is a bitmap cast member with the matte ink applied, the active area is the portion of
the image that is displayed; otherwise, the active area is the sprite’s bounding rectangle.
If used in a behavior, this event is passed the sprite script or frame script reference
me
.
Example
This statement shows a simple button behavior that switches the bitmap of the button when the
mouse pointer rolls over and then back off the button:
-- Lingo syntax
property spriteNum
on mouseEnter me
-- Determine current cast member and switch to next in cast
currentMember = sprite(spriteNum).member.number
sprite(spriteNum).member = current 1
end
on mouseLeave me
-- Determine current cast member and switch to previous in cast
currentMember = sprite(spriteNum).member.number
sprite(spriteNum).member = currentMember - 1
end
// JavaScript syntax
var spriteNum;
function mouseEnter() {
// Determine current cast member and switch to next in cast
currentMember = sprite(spriteNum).member.number;
sprite(spriteNum).member = current 1;
}
function mouseLeave() {
// Determine current cast member and switch to previous in cast
currentMember = sprite(spriteNum).member.number;
sprite(spriteNum).member = currentMember - 1;
}
See also
on mouseEnter
,
on mouseWithin
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...