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")
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.