Hello everyone,
I’m using a script I got from one of the Kirupa tutorials on easing.
My question is, how do I make all of that code react to me pressing the button? Currently the button will envoke the easing, but when the movie loads, the easing happens on its own.
Thanks you!
MovieClip.prototype.ease = function(to:Number, speed:Number) {
if (what._y != to) {
var _this:MovieClip = this;
var aux:MovieClip = this.createEmptyMovieClip(“aux_easeX”, 1337);
var previousPosition:Number = this._y;
if (isNaN(speed) || Number(speed) !== speed || speed<=1) {
speed = 1.2;
}
aux.onEnterFrame = function() {
_this._y = to-(to-_this._y)/speed;
if (_this._y == previousPosition) {
_this._y = to;
this.removeMovieClip();
}
previousPosition = _this._y;
};
} else {
// do nothing
}
};
myMovieClip.ease(200, 1.04);
again.onRelease = function() {
myMovieClip._y = 43;
myMovieClip.ease(200, 1.04);
};