Fix animation example code

key should never be index into an array or there are bugs. Especially in
transitions.

Fixes #853