Flipbook doesnt show

Hello, im facing this problem:

when i kill an enemy in 2d scroller game, i called a function set flipbook death of enemy, play sound killed and finally destroy actor. The thing is that the flipbook of killed enemy doesnt show. Every kind of enemy has its own death flipbook.

When i put a delay after the animation its shown.But i have the function death player with the code decribed above…so in one function i cant set a delay… If i put the delay in “general code” then sometimes the flipbook enter in repetition and is killed many times …??

Any ideas ??

Thanks

You might want to make it an event instead of a function, and bind an event to finished playing so it can destroy the actor then.