blurTo MovieClip prototype          

Clasificado bajo: AS2 (deprecated), Prototipos — drus @ 12:00 am

Prototipo de Kaax, publicado generosamente en After-hours

Actionscript:
import flash.filters.BlurFilter;
MovieClip.prototype.blurTo = function(x, y, speed, blurX, blurY, calidadBlur) {
    this.onEnterFrame = function() {
        if (Math.round(this._x) == Math.round(x) && Math.round(this._y) == Math.round(y)) {
            blurToParando = new BlurFilter(0, 0, 0);
            this._x = Math.round(this._x);
            this._y = Math.round(this._y);
            this.filters = [blurToParando];
            delete this.onEnterFrame;
        } else {
            blurTo = new BlurFilter(blurX--, blurY--, calidadBlur);
            this._x -= (this._x-x)*speed;
            this._y -= (this._y-y)*speed;
            this.filters = [blurTo];
        }
    };
};
//Uso:
mc.blurTo(523, 434, .1, 50, 50, 4);

Enlaces relacionados: No related posts, | Tags: , , , ,



Siguiente página »

AS_toolKit | Powered by WordPress | Skinned by Drus Unlimited | RSS Feed | Copyleft