timer.cancelAll() <--?

I am using Director Class, and to control a bunch of animations i am using timer.paerformWithDelay…

Now at anytime during the game play I have a “home” button they can hit to change scenes back to a menu.

When this happens I get a error for each timer.performWithDelay that’s been fired but is in its “Delayed time”

I have a method to track and manually kill these timers out right now so I don’t get errors. I am wondering if there is a magic solution I am missing… Something like a :

timer.cancelAll() where it will simply cancel… EVERYTHING that’s been triggered… before I Transition screens… [import]uid: 88147 topic_id: 24647 reply_id: 324647[/import]

No, there isn’t an API for this at present.

What you would likely do is create a function using a for loop and run through cancelling all existing timers, which would be quite a lot easier than doing them individually.

Peach :slight_smile: [import]uid: 52491 topic_id: 24647 reply_id: 99853[/import]

yes currently i do just that… i assign each one to a variable… and then when i switch i loop through them and kill them off if they are not Nil…

I am just hoping for a better solution so i wouldn’t even have to assign them to a variable for tracking purposes… :slight_smile:

So a future api of:

timer.cancelAll()

would still be nice. :slight_smile: [import]uid: 88147 topic_id: 24647 reply_id: 99864[/import]

I think Peach means for you to put them in a table using numerical indices then loop through that rather than using individually crafted values. [import]uid: 8271 topic_id: 24647 reply_id: 99878[/import]