Startdrag Function - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

startDrag function

startDrag(target:Object, [lock:Boolean, left:Number, top:Number,
right:Number, bottom:Number]) : Void
Makes the
movie clip draggable while the movie plays. Only one movie clip can be
target
dragged at a time. After a
draggable until it is explicitly stopped by
another movie clip is called.
Availability: ActionScript 1.0; Flash Player 4
Parameters
- The target path of the movie clip to drag.
target:Object
[optional] - A Boolean value specifying whether the draggable movie clip is
lock:Boolean
locked to the center of the mouse position (
clicked the movie clip (
left,top,right,bottom:Number
clip's parent that specify a constraint rectangle for the movie clip.
Example
The following example creates a movie clip,
location by attaching the
is loaded into
pic_mc
var pic_mcl:MovieClipLoader = new MovieClipLoader();
pic_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.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
stopDrag function
(MovieClip.startDrag method)
102
ActionScript language elements
operation is executed, the movie clip remains
startDrag()
stopDrag()
).
false
[optional] - Values relative to the coordinates of the movie
and
startDrag()
using the MovieClipLoader class.
,
_droptarget (MovieClip._droptarget property)
or until a
startDrag()
) or locked to the point where the user first
true
, at runtime that users can drag to any
pic_mc
actions to the movie clip. An image
stopDrag()
action for
,
startDrag

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF