Quantunet.com

My Account

Joins Us
Flash 8 Actionscript 2.0 Knowledgebase
1D Elastic Motion Script  

Download .fla

Actionscript

var k = 0.1;
var targetX = Stage.width/2;
var vx = 0;

ball_mc._x = 50;

onEnterFrame = function() {
dist =(targetX - ball_mc._x);
vx = vx + dist*k;
ball_mc._x += vx;
};





© 2008 Quantunet LLC All Rights Reserved | Intellectual Property | Terms of Use | Privacy
Home | About Quantunet | FAQ's | Contact Us