How can I do it? I want to active glow when the mouse is over a Sprite and remove it when the mouse is out. Is it possible?
I have the following code:
var myGlow:GlowFilter = new GlowFilter();
myGlow.color = 0xFFFFFF;
myGlow.blurX = glowMobilha.blurY = 20;
var miniatura:MovieClip = _scene.d1[link];
miniatura.addEventListener(MouseEvent.CLICK,
function(e:Event):void {
MainSoundManager._sm.stopAllSounds();
GameManager.loadSection(link, false);
});
miniatura.addEventListener(MouseEvent.MOUSE_OVER,
function(e:Event):void {
miniatura.filters = [myGlow];
miniatura.gotoAndStop(2);
_control.visible = true;
_controle.gotoAndPlay(2);
});
miniatura.addEventListener(MouseEvent.MOUSE_OUT,
function(e:Event):void {
miniatura.gotoAndStop(1);
_control.visible = false;
_control.gotoAndStop(1);
});
miniatura.buttonMode = true;
I set the blur at:
miniatura.addEventListener(MouseEvent.MOUSE_OVER,
function(e:Event):void {
miniatura.filters = [myGlow];
miniatura.gotoAndStop(2);
_control.visible = true;
_controle.gotoAndPlay(2);
});
How can I "hide" the blur at:
miniatura.addEventListener(MouseEvent.MOUSE_OUT,
function(e:Event):void {
miniatura.gotoAndStop(1);
_control.visible = false;
_control.gotoAndStop(1);
});
UPDATE I think I found the solution in the following code:
miniatura.addEventListener(MouseEvent.MOUSE_OVER,
function(e:Event):void {
glowMobilha.alpha = 1;
miniatura.filters = [glowMobilha];
_controle.visible = true;
_controle.gotoAndPlay(2);
});
miniatura.addEventListener(MouseEvent.MOUSE_OUT,
function(e:Event):void {
glowMobilha.alpha = 0;
miniatura.filters = [glowMobilha];
_controle.visible = false;
_controle.gotoAndStop(1);
});
is it the best solution?