# Need help with image scoller/slider code (MX2004)

**URL:** <https://forum.kirupa.com/t/need-help-with-image-scoller-slider-code-mx2004/158641>\
**Category:** flash\
**Created:** [August 10, 2005, 9:49pm UTC](https://forum.kirupa.com/t/need-help-with-image-scoller-slider-code-mx2004/158641 "2005-08-10T21:49:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![digitalFree](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@digitalFree](https://forum.kirupa.com/u/digitalFree)\
**Post date:** [August 10, 2005, 9:49pm UTC](https://forum.kirupa.com/t/need-help-with-image-scoller-slider-code-mx2004/158641/1 "2005-08-10T21:49:28Z")

</div>

I am trying to create a slider that will move a series of images in a movie clip based on the location of the slider. The problem I have is that when you click and drag the scroller it will move the images once but after that the images will not move. I am guessing that the problem is with my code. I want to move the \_x of the images movie clip based on the \_x of the slider. Here is the code I am using which is placed in frame one of the “timelineSlider” MC:

[color=blue]//Initial variables  
barLngth = getProperty(this.sliderLine, \_width);  
left\_x = getProperty(this.draggerBtn, \_x);  
right\_x = left\_x + barLngth;  
imgBase\_x = getProperty(this.\_parent.timelineImages, \_x);  
imgWdth = getProperty(this.\_parent.timelineImages, \_width);[/color]

[color=blue]draggerBtn.onPress=function(){  
this.startDrag(true,0,0,sliderLine.\_width,0);  
this.\_parent.onEnterFrame=function(){  
setProperty(\_parent.timelineImages, \_x , imgBase\_x - (((getProperty(draggerBtn, \_x)-left\_x)/bar\_Lngth)\* imgWdth));  
}

}  
draggerBtn.onRelease=draggerBtn.onReleaseOutside=stopDrag;[/color]

If it will help I can send the the original .FLA file by email as it is too large (225kb) to post on the forum. Just send me a message and let me know.

Thanks in advance for your help,
