Why not do this:
wall = display.newImageRect(walls,"redWall.png",W1\*1,H1\*2.2) wall1 = display.newImageRect(walls,"redWall.png",W1\*1,H1\*2.2) function wussup() obs = { wall, wall1 } for cycle=1,2 do object = (obs[cycle]) print(object) object.x = W1\*0.5 object.y = H1\*0.75 end end wussup()
Instead of trying to reference them by a string, just assign the object itself directly to the array. Better yet this:
obs = {} obs[1] = display.newImageRect(walls,"redWall.png",W1\*1,H1\*2.2) obs[2] = display.newImageRect(walls,"redWall.png",W1\*1,H1\*2.2) function wussup() for cycle=1,2 do object = (obs[cycle]) print(object) object.x = W1\*0.5 object.y = H1\*0.75 end end wussup()