# DOF Blur HELP!

**URL:** <https://forum.kirupa.com/t/dof-blur-help/176402>\
**Category:** flash\
**Created:** [January 23, 2006, 9:59pm UTC](https://forum.kirupa.com/t/dof-blur-help/176402 "2006-01-23T21:59:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericlarson007](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@ericlarson007](https://forum.kirupa.com/u/ericlarson007)\
**Post date:** [January 23, 2006, 9:59pm UTC](https://forum.kirupa.com/t/dof-blur-help/176402/1 "2006-01-23T21:59:48Z")

</div>

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;  
}  
};  
};
