# Dragging a slider along the y-axis between fixed positions

**URL:** https://forum.kirupa.com/t/dragging-a-slider-along-the-y-axis-between-fixed-positions/82444
**Category:** flash
**Created:** [March 10, 2005, 10:17am UTC](https://forum.kirupa.com/t/dragging-a-slider-along-the-y-axis-between-fixed-positions/82444 "2005-03-10T10:17:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Joranovski](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Joranovski](https://forum.kirupa.com/u/Joranovski)
#### Post date: [March 10, 2005, 10:17am UTC](https://forum.kirupa.com/t/dragging-a-slider-along-the-y-axis-between-fixed-positions/82444/1 "2005-03-10T10:17:19Z")

</div>

Hi, I’ve got the following situation:

In my flash application I want to slide a button on the y-axis of a kind of thermometer, but I want to establish fixed slider positions so you can only move the slider up and down from fixed position to fixed position.

I already use this bit of code with startDrag and stopDrag behaviours:

```auto
on (press) {
	startDrag ("_root.schuif",true ,245 ,190 ,245 , 480)
	var h
	var v
	h = schuif._x;
	v = schuif._y;
	x = 0;
	var y;
	y = y+50;
	_root.schuif._y = y;
}

on (release) {
	stopDrag ();
	if (_root.schuif._droptarget == "/opdracht") {
		loadMovieNum("geluid.swf",1);
		play();
	}
	
	} 

```

Any help is much appreciated!  
Many thanks in advance
