Display.Remove Help

I created a grid of images (12x12).  At some point, I want to remove some of the images in the grid.

Since all my images are under the variable chip2, How could I remove one of the images in the grid?  Can I use the display.remove()?  How would I specify to delete one of the images (ie. 3rd image in the grid)?

  

Thanks for any help!

Warren

You are already inserting images into a table so you can remove the images with something like this:

display.remove(chipArr2[3]) chipArr2[3] = nil

By the way, you should define chip2 like this:

local chip2 = display.newImageRect(so options, much file names here)

If you don’t want gaps in your table use code

local child = table.remove(chipArr2, i) -- Remove from table if child ~= nil then -- Remove from display and nil it     child:removeSelf()     child = nil end

You can also use two dimensional array.

You are already inserting images into a table so you can remove the images with something like this:

display.remove(chipArr2[3]) chipArr2[3] = nil

By the way, you should define chip2 like this:

local chip2 = display.newImageRect(so options, much file names here)

If you don’t want gaps in your table use code

local child = table.remove(chipArr2, i) -- Remove from table if child ~= nil then -- Remove from display and nil it     child:removeSelf()     child = nil end

You can also use two dimensional array.