how can I loop this? so that i can change all locals setfillcolor to 1
this is my code and it does’nt work, just want to show my logic.
local x1 = display.newRexct(0,0,150,50)
x1:setFillColor(0.2)
local x2 = display.newRexct(0,0,150,50)
x2:setFillColor(0.3)
local x3 = display.newRexct(0,0,150,50)
x3:setFillColor(0.4)
local x4 = display.newRexct(0,0,150,50)
x4:setFillColor(0.5)
local xx
for i = 1,4 do
xx = “x”…(i)
print (xx) – shows x1,x2,x3,x4
xx:setFillColor(1) – error here
end
thanks in advance
