Hi,
I’m having a little problem with how to use the argument sent to a function.
I have this:
_root.onEnterFrame = function() {
setPanning(1);
}
function setPanning(which) {
delta_1 = (_root._xmouse) - (_root.mc1._x);
panning1 = delta_1/8;
sound1.setPan(panning1);
_root.pan1 = "panning1 = " + panning1;
}
However, I’d like to change all 1’s in the setPanning function to ‘which’ so I can also use this function for e.g. mc2, mc3 etc.
(Am I making sense?)
However, I don’t know the correct syntax for this.
I tried something like:
"delta_" + which = (_root._xmouse)-("_root.mc" + which + "._x");
but that doesn’t work.
Who can help me??
Thanks,
FlashMataZZ