Stop/play sprite sheets at specific positions

Hi

I’m building an app with sprite sheet animations. Now hers my problem:

The character should be animated with three (or more) different sprite sheets. Say after intervals of 3 seconds, play animation1 after another 3 seconds play animation2 (in an endless loop). Till here its easy just using a timer.
But when the character is dragged to a specific position (say A) it should play animation3 (and hide the other sprite sheets). How can this be done?

Is there a way to tell the timer to interrupt an action after draging an object and resume its action after , eg. animation3 is played.

Hope its clear enough…

any help much appreciated!

ps: the function is similar to a childrens app called ‘toca band’ --> https://itunes.apple.com/us/app/toca-band/id521640648?mt=8 [import]uid: 145756 topic_id: 32892 reply_id: 332892[/import]

You’d want to cancel the timer and restart it - you can’t pause it (although there may be something in code exchange for this) so you’d also want to keep track of time elapsed.

Edit: My bad- Brent is right. The last time I tackled this, this API didn’t exist. (Kind of tells you how often I pause timers ;-)) - thanks Brent. [import]uid: 52491 topic_id: 32892 reply_id: 130732[/import]

You’d want to cancel the timer and restart it - you can’t pause it (although there may be something in code exchange for this) so you’d also want to keep track of time elapsed.

Edit: My bad- Brent is right. The last time I tackled this, this API didn’t exist. (Kind of tells you how often I pause timers ;-)) - thanks Brent. [import]uid: 52491 topic_id: 32892 reply_id: 130732[/import]

Timers can be paused now using the timer.pause method, and timer.resume to resume. And the sprite should, in theory, be able to be controlled through various functions, sprite control methods, and listeners. In other words, it seems like your entire scenario is both possible and reasonably simple, but I don’t know your experience and skill level with Corona so it’s hard to suggest a specific course at this point.

Best regards,
Brent [import]uid: 9747 topic_id: 32892 reply_id: 130784[/import]

Timers can be paused now using the timer.pause method, and timer.resume to resume. And the sprite should, in theory, be able to be controlled through various functions, sprite control methods, and listeners. In other words, it seems like your entire scenario is both possible and reasonably simple, but I don’t know your experience and skill level with Corona so it’s hard to suggest a specific course at this point.

Best regards,
Brent [import]uid: 9747 topic_id: 32892 reply_id: 130784[/import]