2 frame animation plays 1st frame too fast after first play

I have an animation that is two frames long. I want it to play for 2 seconds total when the player touches the screen (1 second per frame). Currently, when the player touches the screen the first time, it plays correctly. But any time you touch the screen after the first, the first frame only plays for a few milliseconds, before jumping right to the second frame, not lasting the full 2 seconds for the whole animation. Any ideas what I’m doing wrong here?

Code

require "sprite"  
display.setStatusBar( display.HiddenStatusBar )  
  
function HeroBlowEvents( event )  
 print( "hero frame: " .. ( system.getTimer() - g\_Timer ) )  
 if ( event.phase == "end" ) then  
 print( "end frame: " .. ( system.getTimer() - g\_Timer ) )  
 hero:prepare( "blowright" )  
 end  
end  
  
function HeroTouch( event )  
 local phase = event.phase  
 if "began" == phase then  
 print( "play" )  
 hero:play()  
 g\_Timer = system.getTimer()  
 end  
end  
  
function RestartLevel()  
 Runtime:addEventListener( "touch", HeroTouch )  
 heroblowrightspritesheet = sprite.newSpriteSheet( "blow-right.png", 188.5, 158 )  
 heroblowrightspriteset = sprite.newSpriteSet( heroblowrightspritesheet, 1, 2 )  
 sprite.add( heroblowrightspriteset, "blowright", 1, 2, 2000, 1 )  
 hero = sprite.newSprite( heroblowrightspriteset )  
 hero:prepare( "blowright" )  
 hero:addEventListener( "sprite", HeroBlowEvents )   
 hero.x = hero.x + 160  
 hero.y = hero.y + 300   
end   
  
RestartLevel()  

The results of 3 clicks in this prints the following…

play
hero frame: 1045
hero frame: 2068
end frame: 2068

play
hero frame: 21
hero frame: 1040
end frame: 1040

play
hero frame: 20
hero frame: 1039
end frame: 1039
[import]uid: 17341 topic_id: 11744 reply_id: 311744[/import]

@britt72,
What kind of game are you working on? I hope it is a game involving a Whale that blows left or right and Not about a male Hero that blows left or right, that would be a very sad thing and Apple would never approve explicit material…

?:slight_smile: [import]uid: 3826 topic_id: 11744 reply_id: 42756[/import]

Heh…no need to worry. The content is quite tame.

No one has any ideas? [import]uid: 17341 topic_id: 11744 reply_id: 42786[/import]

Sent an email to support@ a few days ago and still haven’t heard back. Any one else have any ideas? Am I doing something wrong, or is this a bug? [import]uid: 17341 topic_id: 11744 reply_id: 43646[/import]