frame animation problem

Hi,
On the code base I found a way to create an animation by filling a table with the needed position.

When I add this code, it kind of works.
There is a nil error in there, which I don’t understand. At the moment the app says that there is a nill error it stutters the animation and continues as planned.
This is the code:

local rotater={}  
 rotater[01]={}  
 rotater[02]={}  
 rotater[03]={}  
 rotater[04]={}  
 rotater[05]={}  
 rotater[06]={}  
 rotater[07]={}  
 rotater[08]={}  
 rotater[09]={}  
 rotater[10]={}  
 rotater[11]={}  
 rotater[12]={}  
 rotater[13]={}  
 rotater[14]={}  
 rotater[15]={}  
 rotater[16]={}  
 rotater[17]={}  
 rotater[18]={}  
 rotater[19]={}  
 rotater[20]={}  
 rotater[21]={}  
 rotater[22]={}  
 rotater[23]={}  
 rotater[24]={}  
 rotater[25]={}  
  
 rotater[01].rotate=1  
 rotater[02].rotate=3  
 rotater[03].rotate=5  
 rotater[04].rotate=7  
 rotater[06].rotate=9  
 rotater[07].rotate=11  
 rotater[08].rotate=13  
 rotater[09].rotate=15  
 rotater[10].rotate=17  
 rotater[11].rotate=19  
 rotater[12].rotate=21  
 rotater[13].rotate=21  
 rotater[14].rotate=19  
 rotater[15].rotate=17  
 rotater[16].rotate=15  
 rotater[17].rotate=13  
 rotater[18].rotate=11  
 rotater[19].rotate=9  
 rotater[20].rotate=7  
 rotater[21].rotate=5  
 rotater[22].rotate=3  
 rotater[23].rotate=2  
 rotater[24].rotate=1  
 rotater[25].rotate=0  
 local animate  
 local posCount = 0  
  
 local function rotateObject()  
 print(posCount)  
 if posCount \<= 25 then  
 lammetjeHoofdGroup.rotation = rotater[posCount].rotate  
  
 posCount = posCount + 1  
  
 else  
 posCount=1  
 timer.cancel(animate)  
 end  
 end  
  
  
 local function rotateAnim()  
 posCount = 1  
 animate = timer.performWithDelay( 1, rotateObject, #rotater )  
 end  
  
 rotateAnim()  

This is the error:
WARNING: Attempting to set property(rotation) with nil

the thing is it doesn’t always trigger at the same time. sometimes after frame 8 sometimes frame 7 etc.

Anyone have any ideas on what is causing this?
Thanks for the help. [import]uid: 100901 topic_id: 27314 reply_id: 327314[/import]

First of all, are you just trying to animate an image rotating? If so, you are doing this in the hardest way possible! [import]uid: 51654 topic_id: 27314 reply_id: 111016[/import]

Hi,
if you look at the rotation, you can see that it rotates back and forth. With a slight pause in the middle.
The regular transition.to that corona provides is linear and depends on creating a lot of onComplete after each other if you want more than just go from point a to b, this creates really linear and non fluent animations. Since they do not provide keyframe animation creating each frame is the way to go, which sucks but that is what corona is providing for an animation option.

I have asked and looked for alternatives to keyframe animation and this is the option provided. [import]uid: 100901 topic_id: 27314 reply_id: 111033[/import]