Javascript dragging

smallbang's icon

The attached JSUI/Mgraphics script is an attempt at a linked multislider to control a parameter and 2 modulation sources.

The 2 issues I'm having are :

1) When dragging modA or modB they can't keep up with the mouse unless moved very slowly.

What would be the best method of hit testing modA&B so that they follow the mouse at speed?

2) Dragging can effect all 3 sliders during one drag event, which is undesirable.

What would be the best method of limiting a drag to the clicked slider?

I'm new to Javascript so the attached script is pretty crude I imagine.

Thanks for any help.

5174.multiSliderTest.js
js
smallbang's icon

I fixed the problems by learning a bit more Javascript!
Building a separate hit test function and utilising "onidle" amongst other things.