I just got through the easing tutorial (http://www.kirupa.com/developer/flash8/easing.htm) and thought that a easing filter variation would be awesome. So I began my own easing blur function but I can’t seem to get it to ease the blur, it just applies the blur without the ease…Maybe my brain is just much for the day…
Any ideas what i’m doing wrong?? ::
import flash.filters.*;
MovieClip.prototype.easeBlur = function(to:Number, speed:Number, endF:Function, endO, endP:Array) {
var blur:BlurFilter = new BlurFilter(to, to, 3);
var _this:MovieClip = this;
_this.filters = [blur];
var aux:MovieClip = _this.createEmptyMovieClip("easeBlur_aux", 1223);
var previousBlur:Number = this.blur;
if (isNaN(speed) || speed == undefined || speed == '' || speed <= 1) {
speed = 1.2;
}
if (_this.blur != to) {
aux.onEnterFrame = function() {
_this.blur = to - (to - _this.blur) / speed;
if (_this.blur == previousBlur) {
_this.blur = to;
this.removeMovieClip();
if (endF) {
endF.apply(endO, endP);
}
}
previousBlur = _this.blur;
};
} else {
if (endF) {
endF.apply(endO, endP);
}
}
};