Hi everyone.
I wonder if Corona has a function that checks if a displayed object is alive or not.
Sample: I create a ship, and a timer to make it fire. But it can be destroyed by other ships’ fires. So how can I check if the ship is still alive in my timer call? I can save timer id to each ship, then cancel it when a ship is being destroyed. But I want to try another way.
And one more question, why doesn’t Corona auto cancel object transition when it’s destroyed? Because not every obj is destroyed with removeSelf function, so I can’t check to stop its transition. In my sample, if my ship is a group, with a light having transition. The transition has a complete function to recall itself. When I remove my ship, this light is removed as well, but it doesn’t call its removeSelf function. It will have an error when light transition recalls it.
Now I must save all ship transId to cancel them. If I have a method to check if object’s alive, I can use that in transition complete function to avoid errors. And it would be great if Corona auto cancel ( or doesn’t call transition complete ) object transition if it’s destroyed.