
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
Содержание DIRECTOR MX 2004-USING DIRECTOR
Страница 1: ...DIRECTOR MX 2004 Using Director...
Страница 16: ...16 Chapter 1 Introduction...
Страница 82: ...82 Chapter 3 Sprites...
Страница 98: ...98 Chapter 4 Animation...
Страница 134: ...134 Chapter 5 Bitmaps...
Страница 242: ...242 Chapter 10 Sound and Synchronization...
Страница 274: ...274 Chapter 11 Using Digital Video...
Страница 290: ...290 Chapter 12 Behaviors...
Страница 302: ...302 Chapter 13 Navigation and User Interaction...
Страница 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Страница 392: ...392 Chapter 16 Working with Models and Model Resources...
Страница 418: ...418 Chapter 18 Movies in a Window...
Страница 446: ...446 Chapter 22 Managing and Testing Director Projects...