Sliders

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!!

let’s say your code looks something like this:

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

at this line after the stopDrag is called:

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

let me know if that works :slight_smile:

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 ();
}

just add the line above after the stopDrag() :slight_smile:

Thanks so much. This is exactly what I wanted. :slight_smile: