Something like this will populate 5 balls into the balls array
local function spawnBall() local ball = display.newCircle(grpball, 60, 60, 13) ball.x, ball.y = math.random(10,300), 50 ball:setFillColor( 0, 1, 0 ) ball:addEventListener("touch", lstballTouch) transition.to( ball, { time=math.random(4000,8000), x=math.random(-10,100) , y=600, onComplete=clearball } ); physics.addBody( ball, "dynamic", { density=0.1, bounce=0.1, friction=0.1, radius=0 } ); return ball end local balls = {} local aNewBall = nil for i = 1, 5 do aNewBall = spawnBall() balls[#balls+1] = aNewBall end