AngelScript SetEventFrame how to?

Hi, can’t find any example or tut about how to use event frames in AngelScript.
For example, if i need to execute some function after animation, logicaly it must be something like this:

 ValueAnimation@ animatePos = ValueAnimation();
 animatePos.SetKeyFrame (0.0f, Variant(Vector3(0.0f,0.0f,0.0f)));
 animatePos.SetKeyFrame (0.1f, Variant(Vector3(30.0f,30.0f,30.0f)));
 animatePos.SetKeyFrame (0.2f, Variant(Vector3(28.0f,40.0f,30.0f)));
 animatePos.SetEventFrame (0.3f, "AnimationEnd");
 node.SetAttributeAnimation("Position", animatePos,WM_ONCE);

void AnimationEnd (StringHash eventType, VariantMap& eventData)
    // some code

but, this not work… please help)

Imho time of EventFrame must be less or equal last key frame in animation.
And you must subscribe for that event.


E_ATTRIBUTEANIMATIONUPDATE may be useful in other cases.