Hi,
I have been stuck on this same problem a number of times and would really like to figure out the solution, which i have no doubt is simple once you know, but it currently eludes me!
Basically I want to assign a function on a number of buttons named “disc1”,“disc2” etc. I want them to have a mouseDown function that sets a global variable to 1,2,3 etc based on the disc number.
This is what i thought would work but obviously it doesn’t!
[INDENT][COLOR=Red]for (i=1;i<5;i++)[/COLOR]
[COLOR=Red]{[/COLOR]
[COLOR=Red] name=“disc”+i;[/COLOR]
[COLOR=Red] [name]onMouseDown = function(){[/COLOR]
[COLOR=Red] activeDisc=i;[/COLOR]
[COLOR=Red] }[/COLOR]
[COLOR=Red]}[/COLOR]
[/INDENT][COLOR=Red]
[COLOR=Black]
How should I do this instead?
Thanks for any help
[/COLOR][/COLOR]