Here’s my code:
frame 1
// quadratic easing out - decelerating to zero velocity
time = 0;
beginX = 100;
changeX = 400;
durationX = 40;
Math.easeOutQuad = function(time, beginX, changeX, durationX) {
return -c*(t /= d)*(t-2)+b;
};
MovieClip.prototype.animate = function(theClip) {
theClip.onEnterFrame = function() {
trace(time);
if (time<=durationX) {
this._x = Math.easeOutQuad(time, beginX, changeX, durationX);
} else {
this.onEnterFrame = null;
}
time++;
};
};
button
on (release) {
animate(myMC);
}
I have a movieClip called ‘myMC’. When I click the button I’d like to have the movieClip animate with the easing out effect. Where am I going wrong here?