Projectile Class Trail Code

I can’t seem to get this to work. It only draws one dot.
[lua]function Star:new()
local Star = display.newImage(‘star.png’)
function Star:follow()
local Starcopy = self
function Star:followMe()
local num = 0
if Starcopy.dots then num = #Starcopy.dots end
local dot = display.newCircle( Starcopy.x, Starcopy.y, 30 )
Starcopy.parent:insert(dot)
Starcopy.dots[num + 1] = dot
end
self.timer = timer.performWithDelay(50, followMe, 0)
end
return Star
end

local sky = display.newGroup()
local Orion = Star:new()
sky:insert(Orion)
Orion.x = 50; Orion.y = 50

Orion:follow()

transition.to(Orion, {x = 1000, y = 1000, time = 8000})[/lua]
–I have edited the code and renamed the title in hope that it will be useful for someone else.

This code will produce circles at the x and y direction every 50 milliseconds. So if the Star is in motion there will be a trail of circles following the Star. It is written to be easily inserted into a class. [import]uid: 54716 topic_id: 12581 reply_id: 312581[/import]

Not getting the full picture from the code that you posted…
Have a few missing links…

what is Star ?
where is the end for function new() ?
function new() does not return any value to pass to variable Orion

can you post a fully working code for this ? the one with which you managed to print a single dot… [import]uid: 71210 topic_id: 12581 reply_id: 46035[/import]

Thanks for the reply and point out my messiness. I edited the post with a solution. My problem was that in:
[lua]self.timer = timer.performWithDelay( 50, self.followMe, 0)[/lua]
The self next to followMe refers to the timer and not star. And then:
[lua]self.timer = timer.performWithDelay( 50, self:followMe(), 0 )[/lua]
Self refers to the star but this form, self:followMe(), is not correct for the timer to perform the same function in iterations.

The solution is to create a local copy of the star and then call it as an upvalue in the followMe() function. [import]uid: 54716 topic_id: 12581 reply_id: 46067[/import]