Name
startDrag( ) Global Function — make a movie or movie clip follow the mouse pointer
Availability
Flash 4 and later
Synopsis
startDrag(target) startDrag(target, lockCenter) startDrag(target, lockCenter, left, top, right, bottom)
Arguments
- target
A string or reference indicating the path to the movie or movie clip instance that should follow the mouse pointer (references to movie clips are converted to paths when used in a string context).
- lockCenter
A Boolean indicating whether the
target’s registration point should be centered under the mouse pointer (true) or dragged relative to its original location (false).
- left
A number specifying the minimum x-coordinate to the left of which
target’s registration point may not be dragged.
- top
A number specifying the minimum y-coordinate above which
target’s registration point may not be dragged.
- right
A number specifying the maximum x-coordinate to the right of which
target’s registration point may not be dragged.
- bottom
A number specifying the maximum y-coordinate below which
target’s registration point may not be dragged.
Description
The startDrag( ) function causes
target to visually follow the mouse
pointer around in the Player (known as dragging
the clip). The movement of a dragging clip can be constrained to a
bounding box whose coordinates are provided as arguments to the
startDrag( ) function. Bounding box coordinates
are given relative to the canvas on which
target resides. If that canvas is the main movie Stage, then (0, 0) is the top-left corner ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access