Name
stopDrag( ) Global Function — end a drag operation in progress
Availability
Flash 4 and later
Synopsis
stopDrag( )
Description
The startDrag( )
function causes a movie clip to follow the
mouse pointer around the Stage. A stopDrag( )
operation stops a dragging movie clip from following the mouse
pointer. Because only one movie clip or movie may be dragged at a
time, stopDrag( ) does not require a
target argument; it simply cancels any
drag operation in progress.
Together with startDrag( ), stopDrag(
) is used to create simple drag-and-drop interfaces in
Flash, as demonstrated under “Interface Widgets” in the
online Code Depot.
Example
The following button code causes a movie clip to be dragged while the button is pressed and dropped when the button is released:
on (press) {
startDrag("", true);
}
on (release) {
stopDrag( );
}See Also
MovieClip.stopDrag( ), startDrag(
), String.toLowerCase( ) ;
Section 4.6.8.1 in Chapter 4
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