Horizontal scrolling a MC with deceleration?
I'm trying to create a scrolling effect much like the one viewable here:
http://www.humaniz.com/work/
Which scrolls left/right depending on the mouse position. I found some (old, old) code that kind of does the trick. After determining that the mouse _y position is correct, it kicks into this looping frame to move the large movieclip:
Code:
mouseposition = getProperty("/myself", _x);
iconsposition = getProperty("/icons", _x);
if (Number(mouseposition)>=400 and Number(iconsposition)>Number(-220)) {
setProperty("/icons", _x, iconsposition-(0.1*(mouseposition-400)));
}
if (Number(mouseposition)<300 and Number(iconsposition)<1034) {
setProperty("/icons", _x, Number(iconsposition)+Number((0.1*(300-mouseposition))));
}
However the code is kinda ancient, and doesn't decelerate when it reaches either end of the movieclip it's scrolling.
Is there an elegant way to handle this?