AnchorAnimation can only be used in a Transition and in conjunction with an AnchorChange. It cannot be used in behaviors and other types of animations.
from AnchorAnimation documentation. There you can also find an example how to use states to do AnchorAnimations.