startDrag()
Availability
Flash Player 4.
Usage
startDrag(target:Object,[lock:Boolean, left:Number, top:Number, right:Number,
bottom:Number]) : Void
Parameters
The target path of the movie clip to drag.
target
A Boolean value specifying whether the draggable movie clip is locked to the center of the
lock
mouse position (
This parameter is optional.
,
,
left
top
right
specify a constraint rectangle for the movie clip. These parameters are optional.
Returns
Nothing.
Description
Function; makes the
be dragged at a time. After a
draggable until it is explicitly stopped by
movie clip is called.
Example
The following example creates a movie clip,
location by attaching the
loaded into
pic_mc
var pic_mcl:MovieClipLoader = new MovieClipLoader();
pic_mcl.loadClip("http://www.macromedia.com/devnet/mx/blueprint/articles/
qa_petmarket/spotlight_thale.jpg", this.createEmptyMovieClip("pic_mc",
this.getNextHighestDepth()));
var listenerObject:Object = new Object();
listenerObject.onLoadInit = function(target_mc) {
target_mc.onPress = function() {
startDrag(this);
};
target_mc.onRelease = function() {
stopDrag();
};
};
pic_mcl.addListener(listenerObject);
See also
MovieClip._droptarget, MovieClip.startDrag(),
786
Chapter 2: ActionScript Language Reference
) or locked to the point where the user first clicked the movie clip (
true
,
Values relative to the coordinates of the movie clip's parent that
bottom
movie clip draggable while the movie plays. Only one movie clip can
target
startDrag()
startDrag()
using the MovieClipLoader class.
ActionScript Language Reference
operation is executed, the movie clip remains
or until a
stopDrag()
, at runtime that users can drag to any
pic_mc
and
actions to the movie clip. An image is
stopDrag()
stopDrag()
CHAPTER 2
action for another
startDrag()
).
false
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers