# Removing Filter on the fly

**URL:** <https://forum.kirupa.com/t/removing-filter-on-the-fly/182154>\
**Category:** flash\
**Created:** [March 15, 2006, 8:44pm UTC](https://forum.kirupa.com/t/removing-filter-on-the-fly/182154 "2006-03-15T20:44:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hexadecimal](https://avatars.discourse-cdn.com/v4/letter/h/9fc348/32.png) [@hexadecimal](https://forum.kirupa.com/u/hexadecimal)\
**Post date:** [March 15, 2006, 8:44pm UTC](https://forum.kirupa.com/t/removing-filter-on-the-fly/182154/1 "2006-03-15T20:44:39Z")

</div>

[COLOR=DarkGreen]Hi guys, i have little problem and hope someone can help me out… So ive attached a drop shadow filter to a mc… but when i roll out of it i want to remove the filter effect… ive searched livedocs and found document.removeFilter(), but i dont really understand how it works =( so here´s my code:[/COLOR]

import flash.filters.DropShadowFilter;  
var myDropFilter:DropShadowFilter = new DropShadowFilter(35, 90, 0x9A9A9A, 5, 30, 30, 1, 50, false, false, false);  
[COLOR=DarkGreen]  
This function is added to several MC:S with a loop the result that it slows down everything  
[/COLOR]target\_mc.onRollOver = function() {  
var myFilters:Array = target\_mc.filters;  
myFilters.push(myDropFilter);  
target\_mc.filters = myFilters;  
};  
[COLOR=DarkGreen]When i roll over it several times it just adds one more drop shadow object to the instance, but i suppose i can control that with some function, i will look into that next… Help please [/COLOR]
