Random objects are created on the screen with the help of code written below. I want to give these random objects name and access it when user taps a particular object, i am actually creating a game when user taps on a particular objects, then only that particular object must shoot. Please give any suggestion thanks...
imageHolder = {}
numOfImages = 10
for i=1,numOfImages do
imageHolder[i] = display.newImageRect("myImage.png", 20, 20)
imageHolder[i].name="images"
imageHolder[i].x = math.random(0, display.contentWidth)
imageHolder[i].y = math.random(0, display.contentHeight)
end