I'm trying to create a matrix of buttons, and I'm trying to get each one to call a master method (called 'select') with its own index as an argument:
Code:
for i = 1,buttonCount
--create button, etc
ctl.onmouseup = function(self) select(i) GUI.IButton.onmouseup(self) end
and it doesn't seem to work. I feel like I don't quite understand what happens when you create this kind of function... does the value of 'i' not get stored with the function?