The maths behind the scrolling is really easy: all you need to do is know the position that your menu is at now; the position you want it to get to and the speed you want it to move at.
Here's the idea applied to a moving clip...
onClipEvent(enterFrame){
//how far is the clip from the target?
difference=target-_x;
//set the speed of the scroll
difference=difference/speed;
//move the clip
_x+=difference;
}
For a simple version of a menu similar to Motown's you just need a single large clip for the menu items the position of which is controlled by a series of buttons each of which set "target" to a new value.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.