codice:MovieClip.prototype.elastic = function() { this.physics = [0.25, 0.9]; this.xspeed = this.yspeed=0; function funcElastic(mc) { with (mc) { xspeed = ((_parent._xmouse-_x)*physics[0])+(xspeed*physics[1]); yspeed = ((_parent._ymouse-_y)*physics[0])+(yspeed*physics[1]); _x += xspeed; _y += yspeed; } updateAfterEvent(); } this.ID_elastic = setInterval(funcElastic, 50, this); };
esempio:
codice:nomeClip.elastic();