Hello all JS guru´s I would like to find a way how to build ui by loop. I created many buttons by loop and I dont know how to call their own function. Buttons are in array.. but when i click on some of them there are on .onClick function.
I need give function to every button and .onClick must bu functional ... i dont know how.
Let me explain this concrete:
I have code:
var mainWin = new Window ("palette","Lip Sync",undefined);
var groupOne = mainWin.add("group",undefined,"grupa jedna");
groupOne.add("statictext", undefined, "XXX");
var groupTwo = mainWin.add("panel", undefined, "yyy");
groupTwo.orientation = "row";
var but =;
for (var i = 1 ; i<= 6; i++)
but[i] =groupTwo.add("button", [undefined,undefined,100+i,100], "buut" + " " + i );
but[i].onClick = function ()
alert ("button ID...show [i] somehow");/// there i need somethink to remember button ID
alert (but.size); //controll alert for button number