So I have 4 rectangles:
local boxGroup = display.newGroup() local box1 = display.newRect(boxGroup,0,0,124,89) box1.x=display.contentCenterX-98 box1.y=display.contentCenterY+110 local box2 = display.newRect(boxGroup,0,0,124,89) box2.x=display.contentCenterX-98 box2.y=display.contentCenterY local box3 = display.newRect(boxGroup,0,0,124,89) box3.x=display.contentCenterX-98 box3.y=display.contentCenterX-30 local box4 = display.newRect(boxGroup,0,0,124,89) box4.x=display.contentCenterX-98 box4.y=display.contentCenterX-140
If I were to move all of them I would have to move each of them individually using buttons like so:
local function moveup() box1.y=box1.y+2 box2.y=box2.y+2 box3.y=box3.y+2 box4.y=box4.y+2 end local button = display.newCircle(display.contentCenterX,display.contentCenterY,30) button:addEventListener("tap",moveup)
However is it possible to move them all together if they were in the same parent group like so:
local function moveup() boxGroup.y=boxGroup.y+2 end local button = display.newCircle(display.contentCenterX,display.contentCenterY,30) button:addEventListener("tap",moveup)
If I cant do that, could I move them if they were all in a table and how would I do it?

