Added animationEndEvent function to the Animation class