Navigation and User Interaction
379
Checking which text is under the pointer with Lingo
Lingo can detect which text component in a text or field cast member is currently under the
mouse pointer. See individual properties and functions in the Lingo Dictionary.
Use Lingo that applies to text and field cast members as follows:
•
To detect which character in a text or field cast member is under the pointer, use the
pointToChar()
function.
•
To detect which item in a text or field cast member is under the pointer, use the
pointToItem()
function.
•
To detect which word in a text or field cast member is under the pointer, use the
pointToWord()
function.
•
To detect which paragraph in a text or field cast member is under the pointer, use the
pointToParagraph()
function.
Use Lingo that applies only to text cast members as follows: To detect whether a specific point is
in a hypertext link within a text cast member and is under the pointer, use the
pointInHyperlink()
function.
Use Lingo that applies only to field cast members as follows:
•
To detect which line in a field is under the pointer, use the
mouseLine
function.
•
To detect which word in a field is under the pointer, use the
mouseWord
function.
Responding to rollovers with Lingo
You often want some action to occur when the user rolls the mouse pointer over a sprite or
a particular place on the Stage. You can use Lingo to specify how the movie responds to
such rollovers.
Director provides several event handlers that run when the pointer rolls over a sprite. Messages for
each of these events are sent to the sprite script, the script of the cast member, the frame script,
and then the movie script. See individual event handlers and functions in the Lingo Dictionary.
•
To set up Lingo that runs when the mouse pointer enters a sprite’s bounding rectangle, place
the Lingo in an
on mouseEnter
event handler.
•
To set up Lingo that runs when the mouse pointer leaves a sprite’s bounding rectangle, place
the Lingo in an
on mouseLeave
event handler.
•
To set up Lingo that runs when the user clicks a sprite, rolls the pointer off the sprite, and then
releases the mouse button, place the Lingo in an
on mouseUpOutside
event handler.
•
To set up Lingo that runs when the mouse pointer is within a sprite’s bounding rectangle when
the playhead enters the frame that contains the sprite, place the Lingo in an
on mouseWithin
event handler.
The
mouseWithin
event can occur repeatedly as long as the mouse pointer remains
inside the sprite.
•
To determine whether the cursor is over a specific sprite, use the
rollOver()
function.
Summary of Contents for DIRECTOR MX-USING DIRECTOR MX
Page 1: ...Using Director MX Macromedia Director MX...
Page 12: ...Contents 12...
Page 156: ...Chapter 4 156...
Page 202: ...Chapter 6 202...
Page 244: ...Chapter 7 244...
Page 292: ...Chapter 10 292...
Page 330: ...Chapter 12 330...
Page 356: ...Chapter 13 356...
Page 372: ...Chapter 14 372...
Page 442: ...Chapter 16 442...
Page 472: ...Chapter 18 472...
Page 520: ...Chapter 19 520...
Page 536: ...Chapter 20 536...
Page 562: ...Chapter 23 562...
Page 566: ...Chapter 24 566...
Page 602: ...Chapter 27 602...