If you are new to easing I recommend you check out the basic easing equations. There are 2 tutorials on this site that use them and they are usually all you need for easing.
Robert Penners equations although fun to mess with and are very good, they are very advanced as well.
The way to get the linear tween equation to work is to put these actions on your movie clip…
[AS]onClipEvent (load) {
var start = this._x;
var end = this._x+_root.endNum;
var duration = _root.dNum;
var t = _root.tNum;
}
onClipEvent (enterFrame) {
t++;
if (t<=duration) {
this._x = Math.linearTween(t, start, end, duration);
}
}[/AS]
dang you guys are good… Again thanks for answering my questions.
If you are curious I am currently working on a remoting app in Flash. Needed to easing for my menu. Once it is live, I will definately post a link here.
kax: Thanks for that. I was thinking about doing that but considering I had to go soon I didn’t have time to go about figuring out and testing it. You rock :A+:
I don’t know if I can tell you something you didn’t know already. It would be easy for you to lie and say you already knew (this is the 8th time this wink smiley has been used in this thread, I love that smiley)
Well, i did a search for penner easing equations, found this, and found out that there is an error in the code, you forgot to pass the t variable kode. heh. so here it is corrected.
MovieClip.prototype.linearTween = function(t, endx, endy, duration) {
var x = (endx-this._x)/duration, y = (endy-this._y)/duration, t;
this.onEnterFrame = function() {
if (t++<duration) {
this._x += x;
this._y += y;
} else {
delete this.onEnterFrame;
}
};
};
and to call
myMovieClip.linearTween(0,200, 200, 24);
I should note that I’m at school and am using a trial version of mx2004, so maybe in MX you don’t have to pass t for it to work… but meh, incase anyone was having a problem.