# Flash 8 and animating filter effects

**URL:** <https://forum.kirupa.com/t/flash-8-and-animating-filter-effects/186522>\
**Category:** flash\
**Created:** [April 21, 2006, 10:48pm UTC](https://forum.kirupa.com/t/flash-8-and-animating-filter-effects/186522 "2006-04-21T22:48:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lazerbrains](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@lazerbrains](https://forum.kirupa.com/u/lazerbrains)\
**Post date:** [April 21, 2006, 10:48pm UTC](https://forum.kirupa.com/t/flash-8-and-animating-filter-effects/186522/1 "2006-04-21T22:48:24Z")

</div>

I read throught this tutorial:

[http://www.kirupa.com/developer/flash8/filter\_effects.htm](http://www.kirupa.com/developer/flash8/filter_effects.htm)

And it soes pretty much what I am looking for, however. If you change the color of the glow effect suddenly, it doesn’t work right anymore. I changed it from the blue it is set to by default, and changed it to a yellow (FFFFCC). But when i doo that the glow overtakes the text. Does anyone have any idea why this would happen? Or does anyone else know how to animate a filter effect.

I am looking to make a button that will glow (animated, not just a one frame rollover state) when rolled over.

Let me know if anyone has any insight on this:cyborg:.

---

<div class="post-metadata">

**Author:** ![Rustyd](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rustyd](https://forum.kirupa.com/u/Rustyd)\
**Post date:** [April 22, 2006, 6:28pm UTC](https://forum.kirupa.com/t/flash-8-and-animating-filter-effects/186522/2 "2006-04-22T18:28:20Z")

</div>

You have to set the Alpha to 0 first then it won’t be visible until you rollover - see the changes in **Bold** below:  
(Note: when you add these changes, right after you type “gf.” you should see a list of properties you can mess with!)

import flash.filters.GlowFilter;  
var gf:GlowFilter = new GlowFilter(0xffff00, **0,** 3, 3, 5, 3, false, false);  
kText.filters = [gf];  
kText.onRollOver = function() {  
\*\* gf.alpha=100;\*\*  
this.onEnterFrame = function() {  
if (gf.blurX \< 20) {  
gf.blurX++;  
gf.blurY++;  
} else {  
delete this.onEnterFrame;  
}  
this.filters = [gf];  
};  
};  
kText.onRollOut = function() {  
**gf.alpha=0;**  
this.onEnterFrame = function() {  
this.filters = [gf];  
if (gf.blurX \> 3) {  
gf.blurX–;  
gf.blurY–;  
} else {  
delete this.onEnterFrame;  
}  
};  
};

---

<div class="post-metadata">

**Author:** ![lazerbrains](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@lazerbrains](https://forum.kirupa.com/u/lazerbrains)\
**Post date:** [April 24, 2006, 4:26pm UTC](https://forum.kirupa.com/t/flash-8-and-animating-filter-effects/186522/3 "2006-04-24T16:26:15Z")

</div>

With a little tweaking, that seemed to work. Thanks for the info and help. I was curious, now if I want to put in a sound effect for that rollover, how would I script that in?

---

<div class="post-metadata">

**Author:** ![Rustyd](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rustyd](https://forum.kirupa.com/u/Rustyd)\
**Post date:** [April 24, 2006, 4:59pm UTC](https://forum.kirupa.com/t/flash-8-and-animating-filter-effects/186522/4 "2006-04-24T16:59:02Z")

</div>

File-\>Import the .wav file into your library and slap it onto a new layer in a keyframe wherever you want it works good for short sounds.

---

<div class="post-metadata">

**Author:** ![lazerbrains](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@lazerbrains](https://forum.kirupa.com/u/lazerbrains)\
**Post date:** [April 24, 2006, 7:10pm UTC](https://forum.kirupa.com/t/flash-8-and-animating-filter-effects/186522/5 "2006-04-24T19:10:54Z")

</div>

Oh, thanks. I thought for some reason I needed to script it in. But that works. I guess I was making it more complicated than it needed to be. Thanks for all the help.
