Working with Movie Clips > Using actions and methods to control Timelines > Dragging movie clips
Dragging movie clips
You can use the startDrag
action or method to make a movie clip draggable while a movie is playing. For example, you can make a draggable movie clip for games, drag-and-drop functions, customizable interfaces, scroll bars, and sliders.
A movie clip remains draggable until explicitly stopped by stopDrag
, or until another movie clip is targeted with startDrag
. Only one movie clip can be dragged at a time.
To create more complicated drag-and-drop behavior, you can evaluate the _droptarget
property of the movie clip being dragged. For example, you might examine the _droptarget
property to see if the movie was dragged to a specific movie clip (such as a "trash can" movie clip), and then trigger another action. See Using "if" statements and Using operators to manipulate values in expressions.