AnimatedSprite2D - Frames

How would you go about determining if the last frame is played of an AnimatedSprite?

For example: you’ve got a mage. The mage casts a spell, but you don’t want the magic fireball to be seen until after the mage swings his wand. How do you know which frame is being played?