# Slider Problems

**URL:** <https://forum.kirupa.com/t/slider-problems/327580>\
**Category:** flash\
**Created:** [March 11, 2012, 11:02am UTC](https://forum.kirupa.com/t/slider-problems/327580 "2012-03-11T11:02:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joenowhere](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@joenowhere](https://forum.kirupa.com/u/joenowhere)\
**Post date:** [March 11, 2012, 11:02am UTC](https://forum.kirupa.com/t/slider-problems/327580/1 "2012-03-11T11:02:18Z")

</div>

I’m new in Flash, now I want to create a timeline slider for photos, i have the AC for that but I can make it even, what’s wrong with my code? and can I add some effect between photos,like fade in fade out? also can I make the slider move when I click on the text about it? I attach the SWF file and the code I have, please help me to fix it, many thanks

```auto
slider._y = slide_area._y;

slider.onPress = function(){
    startDrag(slider, true, 0, slide_area._y, slide_area._width, slide_area._y);
}
slider.onRelease = function(){
    stopDrag();
}
slider.onReleaseOutside = function(){
    stopDrag();
}

total_pos = 6; // how many images you want
area = slide_area._width;
vv = area/total_pos;

for(i=1;i<total_pos;i++){
    this["v"+i] = (vv * i)-vv;
}

this["v"+total_pos] = slide_area._width;

onEnterFrame = function(){
    for(i=1;i<total_pos+1;i++){
        if(slider._x >= this["v"+i]){
            _root.my_images.gotoAndStop(i);
        } 
    }
}

```

(these code is add in the slider, thanks a lot)

Here is the link for my SWF file

[http://www.4shared.com/document/WIG17R8S/test3\_2.html](http://www.4shared.com/document/WIG17R8S/test3_2.html)
