Couldn’t find any proximity stuff for the new filters: particularly BLUR.
I’m trying to get a Depth of Field Effect, the closer the mouse is to the mclip the less blur.
I’ve got proximity text and a blur text but haven’t been able to put them both together. Here they are hope some one can help with a PROXIMITY_BLUR.
PROXIMITY_SCALE
function proximity(circle) {
var x:Number = _root._xmouse;
var y:Number = _root._ymouse;
var cx:Number = circle._x;
var cy:Number = circle._y;
var prox:Number = Math.sqrt((x-cx)(x-cx) + (y-cy)(y-cy));
if(prox<100) {
circle._xscale = 200 - prox;
circle._yscale = circle._xscale;
}
else {
circle._xscale = 100;
circle._yscale = circle._xscale;
}
}
this.onEnterFrame = function() {
proximity(circle);
}
circle.onRollOver = dukes.onRollOver = magnum.onRollOver = function() {
this.swapDepths(_root.getNextHighestDepth());
}
Here is the ROLLOVER_BLUR
import flash.filters.BlurFilter;
var gf:BlurFilter = new BlurFilter(20,20,3);
s.filters = [gf];
s.onRollOver = function() {
this.onEnterFrame = function() {
if (gf.blurX > 1) {
gf.blurX–;
gf.blurY–;
} else {
delete this.onEnterFrame;
}
this.filters = [gf];
};
};
s.onRollOut = function() {
this.onEnterFrame = function() {
this.filters = [gf];
if (gf.blurX < 20) {
gf.blurX++;
gf.blurY++;
} else {
delete this.onEnterFrame;
}
};
};