# ScrollPan

**URL:** <https://forum.kirupa.com/t/scrollpan/45482>\
**Category:** flash\
**Created:** [March 15, 2004, 2:20am UTC](https://forum.kirupa.com/t/scrollpan/45482 "2004-03-15T02:20:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![secondRome](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@secondRome](https://forum.kirupa.com/u/secondRome)\
**Post date:** [March 15, 2004, 2:20am UTC](https://forum.kirupa.com/t/scrollpan/45482/1 "2004-03-15T02:20:08Z")

</div>

[http://www.sixtailer.com](http://www.sixtailer.com)

See the scrollpan with the news on the main page?

I have tried tons of things, but haven’t gotten something I want…

I have made something just now that works like that, except the text doesn’t work completely…

Basically, I have a bounding box with a mask over the test I want…

Code I use (and this is applied to an MC with the whole “container” pan")

```auto
onClipEvent (load) {
	diff_y = bound_box._height-scroller._height;
	bounds = bound_box.getBounds(this);
	top = bounds.yMin+(scroller._height/2);
	bottom = bounds.yMax-(scroller._height/2);
	function updateScrollbar() {
		content._y = -(((scroller._y-top)/diff_y)*(content._height-bound_box._height));
	}
	friction = 0.96;
}
onClipEvent (mouseDown) {
	if (scroller.hitTest(_root._xmouse, _root._ymouse)) {
		startDrag("scroller", false, scroller._x, top, scroller._x, bottom);
		scrolling = true;
	}
}

onClipEvent (mouseUp) {
	stopDrag();
	scrolling = false;
}
onClipEvent (enterFrame) {
	if (scrolling) {
		updateScrollbar();
		newY = scroller._y;
		yspeed = (newY-oldY)*0.50;
		oldY = newY;
		done = false;
	} else if (!done) {
						oldypos = scroller._y;
		newypos = oldypos+yspeed;
		if (yspeed<-0.2 || yspeed>0.2) {
			yspeed *= friction;
		} else {
			yspeed = 0;
			done = true;
		}
				if (newypos<top) {
			yspeed = -1*yspeed*friction;
			newypos = top;
		}
		if (newypos>bottom) {
			yspeed = -1*yspeed*friction;
			newypos = bottom;
		}
						scroller._y = newypos;
		updateScrollbar();
	}
}

```

My problem is basically I place my content box in the mask and it will start the whole thing at half way… the box will scroll and everything works. it’s just that the content starts half way, so half the box will be empty towards the bottom.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 15, 2004, 2:40am UTC](https://forum.kirupa.com/t/scrollpan/45482/2 "2004-03-15T02:40:38Z")

</div>

um well…

now everything works

the scrollbar and all work and stuff

The problem is the text and I think it’s because of the mask

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 15, 2004, 2:46am UTC](https://forum.kirupa.com/t/scrollpan/45482/3 "2004-03-15T02:46:18Z")

</div>

ok i figured it out…

I just need to have the text at the bottom of my movie clip because it scroll ups… shiz

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 15, 2004, 3:03am UTC](https://forum.kirupa.com/t/scrollpan/45482/4 "2004-03-15T03:03:15Z")

</div>

nvm got it…

found a crappy way to do it, but in the end no one knows
