Hello.
Please, have a look at the following code:
//---------------
listenmen = new Object();
var bottom_b:Number = scrollBG._height - scrollBtn._height + scrollBG._y;
listenmen.onMouseWheel = function(delta) {
if (delta > 1) delta = 5;
if (delta < -1) delta = -5;
delta = -delta;
if (delta > 0) {
scrollBtn._y = Math.min(bottom_b, scrollBtn._y + delta);
}
if (delta < 0) {
scrollBtn._y = Math.max(scrollBG._y, scrollBtn._y + delta);
}
setContentTarget();
}
Mouse.addListener(listenmen);
//--------------
This code enables the use of the mousewheel to scroll through a movieclip. What I wanted was to make it more dinamic. As you can see, the delta value determines the speed of the scrolling. I want that this speed be calculated accordding to the height of the movieclip that its being scrolled. I already tried a linear approach by using a simple equation like delta = scrolled_mc._height/50 but isnt really working. So, basically, I want that, if a movieclip is big, the scroll is faster and reverse. So, could somebody help me?
Cheers!