Hi,
I’m trying to make multiple functional sliders which incorporate a progress strip as I move the knob left and right.
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.