Hi.
i’ve been curious for a while, but is it actually okay, or should i rephrase it, return 100% possibility that giving parameter into listener function will work?
here is the snippet code to help understand my question
local function getGlow(num) return function(event) if "began" == event.phase then buttonTable[num] = display.newImage(group, symbols[num].glow, symPos[num].x, symPos[num].y) elseif "moved" == event.phase then elseif "ended" == event.phase or "cancelled" == phase then buttonTable[num] = display.newImage(group, symbols[num].origin, symPos[num].x, symPos[num].y) count = count + 1 print(count) end end end local function makeButton() --local right = symbols[symbolNum] --load all symbols for i = 1, #symbols do buttonTable[i] = display.newImage(group, symbols[i].origin, symPos[i].x, symPos[i].y) buttonTable[i]:addEventListener('touch', getGlow(i)) //is this will return every time?? end end