A new action in Flash 4 allows the user to drag a movie clip around the stage following the mouse. Select the Drag Movie Clip action to either start or stop a drag operation. A movie clip will remain draggable until it is stopped by a Stop Drag action or until another movie clip is made draggable. Only one movie clip can be draggable at a time.The most common way to create a draggable movie clip is by nesting a button inside of the movie clip, and then applying the drag actions to that button. Since the button is nested inside the movie clip the Target can be left blank to indicate itself.
On (Press) Start Drag ("") End On On (Release) Stop Drag Begin Tell Target ("/") Go to and Play ("Drop") End Tell Target End On
The normal drag and drop mouse event combination is On(Press) [drag start] and On(Release) [drag stop], but another good combination is On(Roll over) and On(Press).
There are two Drag Movie Clip options, Lock mouse to center and Constrain to rectangle.
Lock mouse to center 'locks' the center of the movie clip to the cursor, so that the movie clip is dragged around from its center. When not selected, the movie clip maintains a position relative to the position of the cursor when the drag operation started.
If Constrain to rectangle is selected, then the drag movie clip will remain inside of a rectangular boundary. When the drag operatuion begins, if the movie clip is not within of the confines of the constrain, it will pop into it. The top, bottom, left and right values are relative to the parent of the drag movie clip.