# Scroll two movieClips with one Bar

**URL:** <https://forum.kirupa.com/t/scroll-two-movieclips-with-one-bar/211120>\
**Category:** Uncategorized\
**Created:** [December 27, 2006, 4:44pm UTC](https://forum.kirupa.com/t/scroll-two-movieclips-with-one-bar/211120 "2006-12-27T16:44:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dttdar](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dttdar](https://forum.kirupa.com/u/dttdar)\
**Post date:** [December 27, 2006, 4:44pm UTC](https://forum.kirupa.com/t/scroll-two-movieclips-with-one-bar/211120/1 "2006-12-27T16:44:03Z")

</div>

I’m using the code from the Scroll tutorial but I’m trying to modify it because I have two movieclips which need to be scrolled. They have different heights and the maskedview for each content is a different height. I’m trying to get it so that when the scrollFace is at 30%(or any pecentage) of the bar, then content1 & 2 are at the 30% position of their respective content.

```auto
scrolling = function () { 
var scrollHeight:Number = scrollTrack._height; 
var contentHeight:Number = contentMain._height;//// 
var scrollFaceHeight:Number = scrollFace._height; 
var maskHeight:Number = maskedView._height; ////
var initPosition:Number = scrollFace._y=scrollTrack._y; 
var initContentPos:Number = contentMain._y; //////
var finalContentPos:Number = maskHeight-contentHeight+initContentPos; //////
var left:Number = scrollFace._x; 
var top:Number = scrollTrack._y; 
var right:Number = scrollFace._x; 
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y; 
var dy:Number = 0; 
var speed:Number = 10; 
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight); /////
 
scrollFace.onPress = function() { 
var currPos:Number = this._y; 
startDrag(this, false, left, top, right, bottom); 
this.onMouseMove = function() { 
dy = Math.abs(initPosition-this._y); ///////
contentMain._y = Math.round(dy*-1*moveVal+initContentPos);
contentMain2._y = Math.round(dy*-1*moveVal+initContentPos);///////I think this is where the change needs to be at
};
}; 
scrollFace.onMouseUp = function() { 
stopDrag(); 
delete this.onMouseMove;
};
}; 
scrolling(); 

```
