Another Newbie Question!

Hi all,

Ok, I am sort of new to learning advanced actionscript, so please bear with me. (Plus, I am AWFUL with math to make matters worse).

Anyway, I have a Flash MX 2004 project I am working on. It is based on Pom’s volume control slider tutorial here:

http://www.kirupa.com/developer/mx/slider.htm

So, no problem, I have the slider working, but what I need is for the ‘dragger’ clip to also control another clip at the same time, however, this other clip (we can call it dragger2) is on a different layer underneath the main slider clip at the root, so you never actually click on it, it should just follow the ‘dragger’ clip when it is dragged. The ‘dragger2’ clip MUST be a separate clip (and not just on a different layer as part of the original dragger clip) because there is an object inbetween the ‘slider’ clip and the ‘dragger2’ clip on the main stage.

I hope that made sense. So here is the code I have thus far:

this.ratio=0 ;
dragger.onPress=function(){
this.startDrag(false,0,0,line._width,0);
this.onEnterFrame=function(){
ratio=Math.round(this._x*550/line._width) ;
}
}
dragger.onRelease=dragger.onreleaseOutside=stopDrag;

I have tried using Pom’s other tutorial found here to solve the problem:

http://www.kirupa.com/developer/flash5/menudragger.htm

which has a similar effect, but I need the startDrag to be false so the ‘dragger’ doesn’t snap to the mouse center (which is ugly in my case). Plus, there are some other problems with this example when applied to my situation, but that would be another whole paragraph.

So, basically, I just need to add something that says:

if dragger is being dragged, then drag _root.dragger2 right along with it.

Any ideas? Sorry for the long winded post…

Thanks - NOFUTURE

Sorry, I’m not completely clear on what you’re doing , but if you just want dragger2 to drag equal to dragger2, something like:

dragger.onPress=function(){
dragger2._x = dragger._x
}

By the way, I also have a similar tutorial on my site in my sig. You might check out that code to see if it helps.

Hi again!

Thanks for the fast reply!

If you look at this fla file you will see exactly what I am trying to do.

http://www.nofuture.com/helpme.fla

this is just a quick mock-up: You will see the green ‘spinner’ clip behind the red box which is the ‘dragger’. All I want is for that ‘spinner’ to follow the ‘dragger’ when it is dragged from left to right. The ‘spinner’ must stay perfectly aligned with the red box and it must stay on a separate layer below the ‘slider’ clip.

Any further help is MUCH appreciated!

Thanks again,

NOFUTURE

Okay, see the file here:

http://www.kennybellew.com/misc/helpme.fla

I suggest you separate your dragger movie from your line. This makes it easier to track the x axis together with your spinner.

THANKS SO MUCH!! THIS SOLVES IT!!!

NOFUTURE

You’re welcome :slight_smile: