Help animating player

I am currently trying to animate the playable character in a game. I have the animation running but it is separate from the playable character that shows up.
local sprite = require “sprite”
local sheet1 = sprite.newSpriteSheet( “richClimb1.png”, 512, 256 )
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 6)
sprite.add( spriteSet1, “rich”, 1, 6, 1000, 0 ) – play 6 frames every 1000 ms
local instance1 = sprite.newSprite( spriteSet1 )
instance1:prepare(“rich”)
instance1:play()

this is the code I have. It works, but how do I connect it to the player? [import]uid: 94237 topic_id: 16895 reply_id: 316895[/import]

to be a little more specific, I am trying to animate this sprite set on a line.
[import]uid: 94237 topic_id: 16895 reply_id: 63381[/import]