Chaining Tweening Animation

Hi Everyone,

I have a requirement where I have to perform several tweening animations, each executing only after the previous animation is finishing. Does Corona have functionality similar to .NET’s Thread.Wait(…) function to pause execution?

-Muffin [import]uid: 99450 topic_id: 30685 reply_id: 330685[/import]

Hi Muffin,

You can accomplish this in 2 different ways:

  1. Execute a whole series of transitions at the same time, delaying each subsequent transition by the amount of time it takes the previous transition(s) to complete. This is the simple way, but maybe not the “safest” way.

  2. Set up your series of transitions to trigger the “onComplete=…” flag when they finish, “…” being some target function. That function then determines which transition to execute next (maybe via a counter) and does so. The counter increments, the next transition fires, and the process repeats. Ths is the more complicated way, but the safer way too… especially if you need to pause or cancel any of these transitions mid-stream, in which case you could assign and re-assign them to a single reference variable and manage the pause/resume/cancel that way.

Hope this helps!
Brent Sorrentino [import]uid: 9747 topic_id: 30685 reply_id: 122962[/import]

Hi Muffin,

You can accomplish this in 2 different ways:

  1. Execute a whole series of transitions at the same time, delaying each subsequent transition by the amount of time it takes the previous transition(s) to complete. This is the simple way, but maybe not the “safest” way.

  2. Set up your series of transitions to trigger the “onComplete=…” flag when they finish, “…” being some target function. That function then determines which transition to execute next (maybe via a counter) and does so. The counter increments, the next transition fires, and the process repeats. Ths is the more complicated way, but the safer way too… especially if you need to pause or cancel any of these transitions mid-stream, in which case you could assign and re-assign them to a single reference variable and manage the pause/resume/cancel that way.

Hope this helps!
Brent Sorrentino [import]uid: 9747 topic_id: 30685 reply_id: 122962[/import]