views:

513

answers:

3

I'm trying to apply/remove a glow filter to a movie clip on a MOUSE_OVER/MOUSE_OUT event.

Basically when I hover over a movie clip I want the glow to animate on, and then animate back off when I mouse out.

How would I achieve this?

Thanks

A: 
private var glowArray:Array = [new GlowFilter()];

mc.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
mc.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);

private function mouseOver(e:MouseEvent):void
{
  mc.filters = glowArray;
}
private function mouseOut(e:MouseEvent):void
{
  mc.filters = [];
}
Amarghosh
Thanks, this is almost exactly what I'm after, except I would like to tween from no glow to glow, and then back. So the glow increases to a certain amount, and then fades away upon mouse out. Do you know how I would do this?
Probocop
tween the `strength` and/or `blurX/Y` properties of the glow filter as @antpaw suggested
Amarghosh
A: 

its very simple if you're using a tween engine like tweener http://hosted.zeh.com.br/tweener/docs/en-us/properties/FilterShortcuts.html

antpaw
Thanks, I will read up on this
Probocop
A: 

I'd go with the TweenLite library..

TweenMax.to(mc, 1, {glowFilter:{color:0x91e600, alpha:1, blurX:30, blurY:30}});

read the docs && examples here

kajyr