SWiSH Player Support
SWF4 or later - Supported Internally
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().
FlashMX uses the ordering of Left, Top, Right, and Bottom for the constraints. SWiSHscript uses Left, Right, Top, and Bottom. The ordering in SWiSHscript may be changed in a future release to match those set in Actionscript.
Sample
Make Object draggable while mouse is pressed:
onSelfEvent (press) {
this.startDragLocked();
}
onSelfEvent (release) {
stopDrag();
}
See Also
startDragLocked(), startDragUnlocked() and stopDrag().