Syntax
target.startDragLocked([left, right, top, bottom])
Arguments
target: The name of the Object / Sprite to be dragged. If omitted, the default is 'this'.
The optional Arguments, left, right, top and bottom, if specified, define a bounding region for the Sprite. The coordinates are specified relative to the Sprite's parent.
Returns
Nothing.
Description
This Sprite Method makes the target Sprite / Object draggable while the Movie is playing. Only one Sprite / Object can be dragged simultaneously.
The Sprite / Object is locked to the center of the mouse position.
Dragging continues until a stopDrag Action is called or startDragLocked or startDragUnlocked is applied to a different Sprite / Object.
Flash MX Differences
This function is implemented in MX as startDrag().
Sample
Make Object draggable while mouse is pressed:
onSelfEvent (press) {
this.startDragLocked();
}
onSelfEvent (release) {
stopDrag();
}
See Also
startDragLocked(), startDragUnlocked() and stopDrag().