Friday, July 13, 2007
filters_blurFilter.fla
import flash.filters.BlurFilter;
var blur:BlurFilter = new BlurFilter(4, 4, 1);
function onEnterFrame() {
var d = dist(_xmouse, _ymouse, circle._x, circle._y);
blur.blurX = d;
blur.blurY = d;
circle._xscale = circle._yscale=200-d;
if (circle._xscale<30) {
circle._xscale = 30;
circle._yscale = 30;
}
circle.filters = [blur];
}
function dist(x1:Number, y1:Number, x2:Number, y2:Number) {
var dx:Number = x1-x2;
var dy:Number = y1-y2;
return Math.sqrt((dx)*(dx)+(dy)*(dy));
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment