I was looking through an old Kirupa tutorial:
http://www.kirupa.com/developer/actionscript/spring.htm
I’ve used this before, and it always works perfectly. Something that I have never been able to understand, however, are the following lines:
xp = xp * inertia + xk ;
yp = yp * inertia + yk ;
The thing that confuses me about these lines are xp and yp never seem to be declared or set with any initial values before they hit the function, so I keep thinking xp and yp should end up being 0 or undefined (which they obviously aren’t.) Where is Flash getting the xp and yp values initially? Anyone know? Am I just overlooking something?