Thanks for taking a look. Here is the code boiled down to its structure.
local bmType = {} local imageList = {} local image = {} local drawScreen drawScreen = function() bmType.fc = function() imageList = { { name="bm\_clr1", tap = true, w=114, h=418, x=1944, y=209, }, { name="bm\_clr2", tap = false, w=114, h=312, x=1944, y=193, }, { name="bm\_clr3", tap = false, w=114, h=314, x=1944, y=228, }, { name="bm\_clr4", tap = false, w=114, h=312, x=1944, y=262, }, { name="bm\_crossbnd", tap = false, w=118, h=420, x=1944, y=210 }, { name="bm\_cross", tap = false, w=68, h=70, x=1944, y=300 }, { name="bmclear", tap = false, w=150, h=448, x=1944, y=209}, { name="icon\_credits", tap = false, w=68, h=106, x=1944, y=280} } end bmType[fc]() -- call bmType for i = 1, #imageList do image[imageList[i].name] = display.newRect ( imageList[i].x, imageList[i].y, imageList[i].w, imageList[i].h ) -- onTap function onTap = function(event) local ot = event.target local phase = event.phase print("tapped") ot:removeEventListener( "tap", onTap ) return true end -- ADD TAP if imageList[i].tap then image[imageList[i].name]:addEventListener( "tap", onTap ) -- Make the button instance respond to touch events end end end -- end drawScreen drawScreen()