# Trying to advance a movie clip with a slide bar

**URL:** https://forum.kirupa.com/t/trying-to-advance-a-movie-clip-with-a-slide-bar/214499
**Category:** flash
**Created:** [January 29, 2007, 4:56pm UTC](https://forum.kirupa.com/t/trying-to-advance-a-movie-clip-with-a-slide-bar/214499 "2007-01-29T16:56:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RickDC2](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@RickDC2](https://forum.kirupa.com/u/RickDC2)
#### Post date: [January 29, 2007, 4:56pm UTC](https://forum.kirupa.com/t/trying-to-advance-a-movie-clip-with-a-slide-bar/214499/1 "2007-01-29T16:56:44Z")

</div>

I have made a slide bar (named slider) in a flash movie, and i have a movieclip (named runMe which is 5 frames long), i want to use my slide bar to tell the movie clip what frame to be on. So basicly when the slider is on the far left and then as u move it it advances frame by frame till its as far as it can go to the right, at wich point runMe will be at frame 5.

The code i have used(on the first frame of the movie) so far is:

```auto
mouseIsDown = false;
slider.onMouseDown = function() {
if(this.hitTest(_xmouse, _ymouse)){
startDrag(this, false, 0,0,550,0);
mouseIsDown = true;
}
}
slider.onEnterFrame = function() {
if(mouseIsDown){
this.runMe.gotoAndStop(Math.floor(this._x *(this.runMe._currentframe/this.runMe._totalframes)));
}
}
slider.onMouseUp = function(){
this.stopDrag();
mouseIsDown = false;
}

```

I have been playing for hrs, and dont seem to be making any progres, any help would be great.

Thanks

Rick
