# Dragging multiple objects in as3

**URL:** <https://forum.kirupa.com/t/dragging-multiple-objects-in-as3/304860>\
**Category:** flash\
**Created:** [February 15, 2010, 5:21pm UTC](https://forum.kirupa.com/t/dragging-multiple-objects-in-as3/304860 "2010-02-15T17:21:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![earleaw](https://avatars.discourse-cdn.com/v4/letter/e/c68b51/32.png) [@earleaw](https://forum.kirupa.com/u/earleaw)\
**Post date:** [February 15, 2010, 5:21pm UTC](https://forum.kirupa.com/t/dragging-multiple-objects-in-as3/304860/1 "2010-02-15T17:21:17Z")

</div>

Hello everyone. I’ve been fighting this for a few hours, and I’m sure some of you have an easy solution. I’ve attached my .fla file for your review.

Basically, I have need to simultaneously move a slider (called “shadeGrabber”) movie clip and a mask. I’d like to do this by dragging the slider and seeing the mask move with it.

The example movie clip on the left (called “PICTURE\_WIPE”) is what I’m going for, but interactive instead. I’m working in the movie clip on the right (called “PICTURE\_WIPE copy 2”)

Here’s my code, for quick reference (found on the “AS” in the “PICTURE\_WIPE copy 2” movie clip:

==========

var downOrUp:String=“up”;  
var overOrOut:String=“out”;  
trace(downOrUp);

shadeGrabberMC.addEventListener(MouseEvent.MOUSE\_DOWN, sliderDown);  
function sliderDown(event:MouseEvent):void {  
var downOrUp=“down”;  
trace(downOrUp);  
}

shadeGrabberMC.addEventListener(MouseEvent.MOUSE\_UP, sliderUp);  
function sliderUp(event:MouseEvent):void {  
var downOrUp=“up”;  
trace(downOrUp);  
}

shadeGrabberMC.addEventListener(MouseEvent.MOUSE\_OVER, sliderOver);  
function sliderOver(event:MouseEvent):void {  
var overOrOut:String=“over”;  
trace(overOrOut);  
}

shadeGrabberMC.addEventListener(MouseEvent.MOUSE\_OUT, sliderOut);  
function sliderOut(event:MouseEvent):void {  
var overOrOut:String=“out”;  
trace(overOrOut);  
}

shadeGrabberMC.addEventListener(MouseEvent.MOUSE\_MOVE, sliderDrag);  
function sliderDrag(event:MouseEvent):void {  
if (overOrOut==“over”&&downOrUp==“down”) {  
shadeGrabberMC.y=mouseY;  
photoMASK.y=mouseY;  
}  
}
