Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    Call function once animation finishes

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
Here is the code I use to create an animation... what code would I add to call a function when the animation finishes?

function ZoomToDistance(distance)
{
i++;
var keyframes = "0 1";
var timeline = "* ["+distance+"]";

targ = MTSMarkup("Target", "", "Name", "MTSCamera", "Property", "orbd", "Timeline", "T1");
time = MTSMarkup("Time", keyframes);
tili = MTSMarkup("Timeline", timeline, "Name", "T1", "Type", "1D");
tiEl = MTSMarkup("MTSTimeElem", targ+time+tili, "Type", "Keyframe", "Name", "myCameraAnim"+i, "On", "0");
vmp.Execute(tiEl);
vmp.TriggerAnim("myCameraAnim"+i);
}
 
Posts: 48 | Registered: April 17, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Does the animator doing the animation exist in the MTX via the <MTSTimeElem> tag? Or is it only written into the mtx dynamically via your javascript?
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  JavaScript    Call function once animation finishes