What Is Stop, Drop and Roll?
startDrag is a function in Flash that functions as a draggable during movie playback.
startDrag
Right!
- Chinese name
- startDrag
- Belong to
- Flash
- Function
- Drag during movie playback
- Usability
- ActionScript 1.0 Flash Player 4
- Parameter
- target:
- startDrag is a function in Flash that functions as a draggable during movie playback.
- startDrag is a function in Flash
- startDrag (target: Object, [lock: Boolean, left: Number, top: Number, right: Number, bottom: Number]): Void
- Makes the target movie clip draggable during movie playback. You can only drag one movie clip at a time. After the startDrag () operation is performed, the movie clip remains draggable until the drag is explicitly stopped with stopDrag () or until the startDrag () action is called on another movie clip. [1]
- ActionScript 1.0, Flash Player 4,
- Movie clip method can only be applied to ActionScript 1.0, Flash Player5
- target:
- The following example creates a movie clip pic_mc at run time, and the user can drag it to any position by attaching the startDrag () and stopDrag () actions to the movie clip. Images are loaded into pic_mc using the MovieClipLoader class.
- var pic_mcl: MovieClipLoader = new MovieClipLoader ();
pic_mcl.loadClip ("Write image URL here",
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);
- this.createEmptyMovieClip ("mc_1", 1);
with (mc_1) {
lineStyle (1, 0xCCCCCC);
beginFill (0x4827CF);
moveTo (0, 0);
lineTo (80, 0);
lineTo (80, 60);
lineTo (0, 60);
lineTo (0, 0);
endFill ();
}
mc_1.onPress = function () {
this.startDrag ();
};
mc_1.onRelease = function () {
this.stopDrag ();
}; [2]