MovieClip.startDrag( ) Method | Flash 5 |
make a movie or movie clip follow the mouse |
A Boolean indicating whether the registration point of mc should be centered under the mouse pointer (true) or dragged relative to its original location (false).
A number specifying the x-coordinate to the left of which mc's registration point cannot be dragged.
A number specifying the y-coordinate above which mc's registration point may not be dragged.
A number specifying the x-coordinate to the right of which mc's registration point cannot be dragged.
A number specifying the y-coordinate below which mc's registration point cannot be dragged.
The MovieClip.startDrag( ) method is an alternative to the global startDrag( ) function. When invoked as a MovieClip method, startDrag( ) does not take a target parameter; it drags mc. The MovieClip method syntax is less prone to user error than its global function counterpart because no target parameter is required.
For usage instructions, see the global startDrag( ) function.
Note that the correct order of the constraining rectangular coordinates is left, top, right, bottom, but the Flash 5 ActionScript Dictionary lists them in the wrong order under MovieClip.startDrag( ).
// Code to drag and drop the current clip or movie this.onPress = function () { this.startDrag(true); }; this.onRelease = function () { stopDrag(); }
MovieClip.stopDrag( ), startDrag( ), stopDrag( ); Section 13.7