# Changing "menu with slider" (tutorial). Need a little help

**URL:** <https://forum.kirupa.com/t/changing-menu-with-slider-tutorial-need-a-little-help/284661>\
**Category:** flash\
**Created:** [March 21, 2009, 9:31pm UTC](https://forum.kirupa.com/t/changing-menu-with-slider-tutorial-need-a-little-help/284661 "2009-03-21T21:31:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![whoopicg](https://avatars.discourse-cdn.com/v4/letter/w/e47774/32.png) [@whoopicg](https://forum.kirupa.com/u/whoopicg)\
**Post date:** [March 21, 2009, 9:31pm UTC](https://forum.kirupa.com/t/changing-menu-with-slider-tutorial-need-a-little-help/284661/1 "2009-03-21T21:31:33Z")

</div>

Hi. I’ve used the **“menu with slider” tutorial, from Bryan Arciniega**. I’ve changed to y coordinate so it could work with vertical movemente (mine is a drop down menu). In my case, it’s now a rectangle that goes over the buttons. Well, everything was going well, the slider was going up and down and stopping where it was supposed, with easing, along de Y axis.

The thing is that I would like it to, if we went through de x axis with de mouse (I mean outside that sub menu) and also when we click a button, the slider would go back to the initial position, through the Y axis. Meaning, if we stopped interacting with the menu, the slider would go back to its origin.

**In the actions layer I’ve used this script:**  
easeSpeed = 2;

slider\_mc.onEnterFrame = function() {

this.\_y += (yMove1-this.\_y)/easeSpeed;

};  
marca\_btn.onPress = function() {

yMove = marca\_btn.\_y;

};  
colecções\_btn.onPress = function() {

yMove = colecções\_btn.\_y;

};  
contactos\_btn.onPress = function() {

yMove = contactos\_btn.\_y;

};  
newsletter\_btn.onPress = function() {

yMove = newsletter\_btn.\_y;

};

**In each button I’ve used:**  
on (rollOver) {  
slider.yMove = colecções\_btn.\_y;  
}

\*\*In the slider I’ve used:  
onClipEvent (load) {

yMove = \_y;  
easeSpeed = 2;

}  
onClipEvent (enterFrame) {

\_y += (yMove-\_y)/easeSpeed;

}  
Well, that’s it.  
And thank you!
