Click to See Complete Forum and Search --> : is it possible to drag two movieclip at the same time?


johnix
09-06-2007, 12:25 PM
is it possible to drag two movieclip at the same time?
i have this code in my main timeline

Icons.onPress=function() {
Icons.startDrag();
map.startDrag();
}
the Icons and the map is same size and in the same possition.. what i want to do is when i drag the Icons the map will also follow moving..
but it doesnt work.. pls help me... im just newbie in flash... thanks in advance...

discorax
09-11-2007, 01:06 PM
I don't believe you can drag two items at the same time...but I could be wrong.
You could accomplish this task by linking the location of one movie clip to the one you're dragging.

this.onMouseMove = function():Void{
map._x = Icons._x;
map._y = Icons._y;
}
Icons.onPress = function():Void{
this.startDrag();
}
Icons.onRelease = function():Void{
stopDrag();
}

There you go, now when you start dragging the Icons MovieClip the map MovieClip will follow it.