User Guide

294 Chapter 13: Navigation and User Interaction
Jumping away and returning to the original location
You might want a movie to jump to a different frame or a separate movie and then return to the
original frame. For example, at a website that describes the weather, you could jump to a movie
segment that explains a weather term and then return to the original location.
To jump away and return to the original location:
Use the play and play done methods.
The
play method branches a movie to another frame, another movie, or a specified frame in
another movie. The
play done method remembers the original frame and returns to it
without requiring that you specify where to return.
Use the
play and play done methods in the following situations:
When the movie you want to play does not have instructions about where to return.
When you want to play several movies sequentially from a single script. When one movie
finishes, the movie returns to the script that issued the
play method.
When you want to put one sequence inside another sequence and easily return to where you
were in the outer sequence.
When you want to jump to one loop from several different locations.
For more information about these methods, see the Scripting Reference topics in the Director
Help Panel.
Detecting mouse clicks with Lingo or JavaScript syntax
Users can click the mouse button in several ways, each of which can be detected by script. The
following are ways that you can use Lingo or JavaScript syntax to detect what the user does with
the mouse. For more information, see the Scripting Reference topics in the Director Help Panel.
To determine the last place the mouse was clicked, use the clickLoc() method.
To determine the last active sprite (a sprite with a script attached) that the user clicked, use the
clickOn method.
To determine whether the last two clicks were a double-click, use the doubleClick method.
To determine the time since the mouse was last clicked, use the lastClick() method.
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