# Sliders

**URL:** <https://forum.kirupa.com/t/sliders/27625>\
**Category:** Uncategorized\
**Created:** [August 4, 2003, 9:34pm UTC](https://forum.kirupa.com/t/sliders/27625 "2003-08-04T21:34:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eaydin](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@eaydin](https://forum.kirupa.com/u/eaydin)\
**Post date:** [August 4, 2003, 9:34pm UTC](https://forum.kirupa.com/t/sliders/27625/1 "2003-08-04T21:34:20Z")

</div>

Hi guys,

I made a basic slider on Flash MX, and it is sliding on a line from 1 to 100. What I want to do is devide the line in 10 portions. When I slide my slider I want it to stop at these fixed places. So lets say I am sliding from 1 to 10 and I stop at 6, I want it automatically go to 10, and if I stop at 3 I want it to go to 1. Same thing for any other portions. Is there a way to check an object’s position, and change its position depending on a condition.

Any input is greately appriciated!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2003, 9:40pm UTC](https://forum.kirupa.com/t/sliders/27625/2 "2003-08-04T21:40:50Z")

</div>

let’s say your code looks something like this:

```auto
mypointer.onPress = function() {
this.startDrag(0,0,0,100,0)
}
mypointer.onRelease = function() {
this.stopDrag()
}

```

at this line after the stopDrag is called:

```auto
this._x = Math.round(this._x/10)*10

```

let me know if that works 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2003, 9:56pm UTC](https://forum.kirupa.com/t/sliders/27625/3 "2003-08-04T21:56:50Z")

</div>

Actually my code is something like this. Looks like yours but different. This is my first time coding something in Flash MX, so I tought you can help me based on my code;

on (press) {  
startDrag ("", false, -50, 0, 50, 0);  
}  
on (release, dragOut) {  
stopDrag ();  
}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2003, 9:59pm UTC](https://forum.kirupa.com/t/sliders/27625/4 "2003-08-04T21:59:15Z")

</div>

just add the line above after the stopDrag() 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 4, 2003, 10:06pm UTC](https://forum.kirupa.com/t/sliders/27625/5 "2003-08-04T22:06:47Z")

</div>

Thanks so much. This is exactly what I wanted. 🙂
