Is there any way to get an elastic motion using the traditional method in Flash 8.
By traditional method I’m reffereng to
x=(x*.1)+(target_current_difference*.9)
_x += x
The tween class is cool but I’d like to use the old way because it gives me more controll.
Ah, I remember now. Yes it does, but you have to tweak the code a bit. Try searching for my other post, I gave sample. Ill try to post it when I have time.
Thanks for the help BlueNar. I managed to dig up the post you were reffereng to. The continueTo function helped me out alot. It didn’t totally alleviate me of the desire to make the old equation work, but it’s good enough for now.
Thats not the one I was referring to, as that still does use the Tween class. I tried doing it out of memory, lemme know if it works.
[AS]MovieClip.prototype.move = function (centerx:Number,centery:Number,inertia:Number,k:Number):Void {
this.vx = -this._x + centerx ;
this.vy = -this._y + centery ;
this.xp = this.xp * inertia + this.vxk ;
this.yp = this.yp * inertia + this.vyk ;
this._x += this.xp ;
this._y += this.yp ;
}
//on the mc
onClipEvent (enterFrame) {
this.move (_root._xmouse,_root._ymouse,0.9,0.1) ;
}
onClipEvent(load) {
this.xp = 0;
this.yp = 0;
}[/AS] Notice the load event. The variables xp and yp must be initiated before they can be used in the function. Otherwise they are NaN. Hope that helps! :cowboy: