for-do-end(for loop) error for no reason

Hi, I’ve been trying to do circles in this way :

[lua]

local number1 = mRandom(5)

local extra = 1

for i=1,number1 do

circle[i] = display.newCircle(group,centerX-120+(30*extra), centerY,15);

circle[i]:setFillColor(0,0,0);

extra = extra +1;

print(i)

end

[/lua]

but I get error every time for no reason ?

I’m stuck now -_-

It would really help to know what the error is. 

But if that’s all your code, then you never create the circle table.  Put: 

local circle = {}

somewhere before the for loop.

Rob

Rob, thank so much for this, you just saved my life.

It would really help to know what the error is. 

But if that’s all your code, then you never create the circle table.  Put: 

local circle = {}

somewhere before the for loop.

Rob

Rob, thank so much for this, you just saved my life.