Okay
Hi.
This sort of thing:
local littleM = {} for column = 1, 18 do for row = 1, 8 do littleM[column] = display.newImage( "buttonMute.png", (11 + (column\*50)), (400 - (row\*40)) ) ...
is probably not quite what you want. You’re overwriting the same slot in the table 7 times, before ending up with the reference of the last image. It follows that you’ll be missing 7 out of 8 references when you do cleanup, if you don’t go through the group directly.
One of the following would be more correct:
local littleM = {} -- If you need to access the columns later (needs slightly more care cleaning up)... for column = 1, 18 do local littleMC = {} littleM[column] = littleMC for row = 1, 8 do littleMC[row] = display.newImage( "buttonMute.png", (11 + (column\*50)), (400 - (row\*40)) )
or
local littleM = {} -- Just need to have them in the array for column = 1, 18 do for row = 1, 8 do littleM[#littleM + 1] = display.newImage( "buttonMute.png", (11 + (column\*50)), (400 - (row\*40)) )
Edit: Hmm, this was rather old, I guess.
Hi.
This sort of thing:
local littleM = {} for column = 1, 18 do for row = 1, 8 do littleM[column] = display.newImage( "buttonMute.png", (11 + (column\*50)), (400 - (row\*40)) ) ...
is probably not quite what you want. You’re overwriting the same slot in the table 7 times, before ending up with the reference of the last image. It follows that you’ll be missing 7 out of 8 references when you do cleanup, if you don’t go through the group directly.
One of the following would be more correct:
local littleM = {} -- If you need to access the columns later (needs slightly more care cleaning up)... for column = 1, 18 do local littleMC = {} littleM[column] = littleMC for row = 1, 8 do littleMC[row] = display.newImage( "buttonMute.png", (11 + (column\*50)), (400 - (row\*40)) )
or
local littleM = {} -- Just need to have them in the array for column = 1, 18 do for row = 1, 8 do littleM[#littleM + 1] = display.newImage( "buttonMute.png", (11 + (column\*50)), (400 - (row\*40)) )
Edit: Hmm, this was rather old, I guess.