# Cannot manage to make multiple sliders functional

**URL:** <https://forum.kirupa.com/t/cannot-manage-to-make-multiple-sliders-functional/332311>\
**Category:** flash\
**Created:** [April 13, 2014, 1:22am UTC](https://forum.kirupa.com/t/cannot-manage-to-make-multiple-sliders-functional/332311 "2014-04-13T01:22:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asomikrahl](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@asomikrahl](https://forum.kirupa.com/u/asomikrahl)\
**Post date:** [April 13, 2014, 1:22am UTC](https://forum.kirupa.com/t/cannot-manage-to-make-multiple-sliders-functional/332311/1 "2014-04-13T01:22:37Z")

</div>

Hi,

I’m trying to make multiple functional sliders which incorporate a progress strip as I move the knob left and right.  
 ![](http://forum.kirupa.com/uploads/kirupa/6726/dbeddfae6071b96d.png)  
I’ve managed to make the first slider functional by converting the whole as a movie clip (with knob & progress bar as movie clips as well) with the following script:  
**import flash.events.MouseEvent;**  
**import flash.geom.Rectangle;**  
**import flash.events.Event;**

**slider\_mc.progress\_mc.scaleX = 1;**  
**slider\_mc.mc.addEventListener(MouseEvent.MOUSE\_DOWN,startdrag)**

**function startdrag(event:MouseEvent):void**  
**{**

\*\* slider\_mc.mc.startDrag(true,new Rectangle(5,-1.25,110,0));\*\*  
\*\* slider\_mc.mc.addEventListener(Event.ENTER\_FRAME,mcpos)\*\*  
\*\* function mcpos(event:Event):void \*\*  
\*\* {\*\*

\*\* slider\_mc.progress\_mc.scaleX = (slider\_mc.mc.x)/60;\*\*  
\*\* }\*\*  
**}**

**slider\_mc.mc.addEventListener(MouseEvent.MOUSE\_UP,stopdrag)**

**function stopdrag(event:MouseEvent):void**  
**{**

\*\* slider\_mc.mc.stopDrag();\*\*  
\*\*}

\*\*My problem is that I cannot seem to make an exact same functionnal one, when I copy/paste the movie clips, rename them (slider\_mc2, mc2, progress\_mc2…) and replace the terms in the script as well as the functions (startdrag2, stopdrag2) the copy doesn’t work.

I was told to use Flash for this project and have never worked with code before and loosing my mind over this.

If there is a simpler way I make copies of my initial functional slider, I’d love the advice.
