# Menu with Slider Tutorial

**URL:** <https://forum.kirupa.com/t/menu-with-slider-tutorial/260897>\
**Category:** flash\
**Created:** [May 20, 2008, 8:52pm UTC](https://forum.kirupa.com/t/menu-with-slider-tutorial/260897 "2008-05-20T20:52:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![reactor88](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@reactor88](https://forum.kirupa.com/u/reactor88)\
**Post date:** [May 20, 2008, 8:52pm UTC](https://forum.kirupa.com/t/menu-with-slider-tutorial/260897/1 "2008-05-20T20:52:02Z")

</div>

Hi- I was playing around with the old Menu with Slider Tutorial:

[http://www.kirupa.com/developer/mx2004/menu\_with\_slider.htm](http://www.kirupa.com/developer/mx2004/menu_with_slider.htm)

And it works as I would expect it to. I ended up modifying it to work vertically instead of horizontally, deleted the what would appear to be a lot of unecessary code, and moved all of the actionscript code off the button instances and to the main timeline. I was doing fine until I tried moving the code that is applied to the “slider” clip:

onClipEvent (load) {  
yMove = \_y;  
easeSpeed = 5;  
}  
onClipEvent (enterFrame) {  
\_y += (yMove-\_y)/easeSpeed;  
}

I’m not exactly sure what modifications I need to make to this code in order to put it with the rest of the code on the main timeline here:

button\_1.onRollOver = function() {  
slider.yMove = button\_1.\_y;  
};  
button\_2.onRollOver = function() {  
slider.yMove = button\_2.\_y;  
};  
button\_3.onRollOver = function() {  
slider.yMove = button\_3.\_y;  
};  
button\_4.onRollOver = function() {  
slider.yMove = button\_4.\_y;  
};

I tried this:

slider.onLoad = function() {  
yMove = \_y;  
easeSpeed = 5;  
};  
slider.onEnterFrame = function() {  
\_y += (yMove-\_y)/easeSpeed;  
};  
button\_1.onRollOver = function() {  
slider.yMove = button\_1.\_y;  
};  
button\_2.onRollOver = function() {  
slider.yMove = button\_2.\_y;  
};  
button\_3.onRollOver = function() {  
slider.yMove = button\_3.\_y;  
};  
button\_4.onRollOver = function() {  
slider.yMove = button\_4.\_y;  
};

But it doesn’t work now. Any help would be appreciated. Thanks.
