# Sliding bar

**URL:** https://forum.kirupa.com/t/sliding-bar/164718
**Category:** Uncategorized
**Created:** [October 4, 2005, 7:54am UTC](https://forum.kirupa.com/t/sliding-bar/164718 "2005-10-04T07:54:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![brownpen](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@brownpen](https://forum.kirupa.com/u/brownpen)
#### Post date: [October 4, 2005, 7:54am UTC](https://forum.kirupa.com/t/sliding-bar/164718/1 "2005-10-04T07:54:36Z")

</div>

Hi, i encountering a problem… I have 6 buttons, and a thin bar… I am doing an effect whereby when i click on the 6th button the bar will move and stop at the 6 button, and when i click on the 2nd button it will move and stop at the 2nd button… but i cant stop the bar… Can anyone help out there?

[color=navy] **bar = slider** [/color]  
[color=navy] **button = btn\_1** [/color]

**Each btn script:**  
on (press) {  
slider.yMove = btn\_1.\_y;  
}

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