Startdrag Function - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

See also
getProperty function

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.
Note: This method is supported in Flash Lite only if
or
true
System.capabilities.hasStylus
Availability: ActionScript 1.0; Flash Lite 2.0
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);
82
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.
or until a
startDrag()
System.capabilities.hasMouse
is
.
true
) 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
is

Advertisement

Table of Contents
loading

Table of Contents