Update AnimationHandler.js

Fix for issue #5516
Merge pull request #5542 from titansoftime/dev

Update AnimationHandler.js