flash scroll mousewheel help, Part 2
thanks to
emma_rising, I've got one step closer, but I'm still having an issue with this.. Here's the AS:
mouseListener = new Object();
mouseListener.onMouseWheel = function (delta) {
if (content._y<-170) {
content._y = -169.9;
} else if (content._y>1) {
content._y = 1;
} else {
content._y += delta*3;
}
if (scroller._y<13) {
scroller._y=13;
} else if (scroller._y>499.2) {
scroller._y=499.1;
} else {
scroller._y -= delta*7.8;
}
}
Mouse.addListener(mouseListener);
The problem is that when you get to the end it really jumps.. I suppose it's because if you land on something like 498.5 it still ads the 7.8 on top and then bops back to 499.1 when you scroll again. The jumping is reduced if I don't do the "delta*7.8" part but then the scrolling is pretty slow.
and if I put a hard stop in it, so that it finished on 499.2 and doesn't scroll anymore, than the scroller is stuck at the bottom and won't go back up.
Anybody have any ideas?
mouseListener = new Object();
mouseListener.onMouseWheel = function (delta) {
if (content._y<-170) {
content._y = -169.9;
} else if (content._y>1) {
content._y = 1;
} else {
content._y += delta*3;
}
if (scroller._y<13) {
scroller._y=13;
} else if (scroller._y>499.2) {
scroller._y=499.1;
} else {
scroller._y -= delta*7.8;
}
}
Mouse.addListener(mouseListener);
The problem is that when you get to the end it really jumps.. I suppose it's because if you land on something like 498.5 it still ads the 7.8 on top and then bops back to 499.1 when you scroll again. The jumping is reduced if I don't do the "delta*7.8" part but then the scrolling is pretty slow.
and if I put a hard stop in it, so that it finished on 499.2 and doesn't scroll anymore, than the scroller is stuck at the bottom and won't go back up.
Anybody have any ideas?
