Jump to content
Search Community

help using glowFilter on a button as3

chbH test
Moderator Tag

Recommended Posts

Hi guys, I need help. I might be missing something that I'm too stupid to see. I'm trying to use glowfilter on a movie clip rollover and rollout function. The problem is, it always starts with the glow on. I want it to start without it so that when the mouse is over it, it glows and reverses when i roll out.

 

Here's my code.

import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
TweenPlugin.activate([GlowFilterPlugin]);


var glow:TweenMax = TweenMax.to(start_btn, .3, {glowFilter:{color:0xffffff, alpha:1, blurX:30, blurY:30, paused:true}});

start_btn.addEventListener(MouseEvent.ROLL_OVER, startrollover);
start_btn.addEventListener(MouseEvent.ROLL_OUT, startrollout);


function startrollover(e:MouseEvent):void{
glow.restart();

}

function startrollout(e:MouseEvent):void{
glow.reverse();
}

I'm new to as3 by the way. Maybe it's something with the way I wrote the code?..

Link to comment
Share on other sites

Yeah, I think its just a little simple mistake. It appears the paused:true is in the wrong spot. Right now it is in with the glowFilter settings, try moving it out of there.

 

BAD

var glow:TweenMax = TweenMax.to(start_btn, .3, {glowFilter:{color:0xffffff, alpha:1, blurX:30, blurY:30, paused:true}});

 

GOOD

var glow:TweenMax = TweenMax.to(start_btn, .3, {glowFilter:{color:0xffffff, alpha:1, blurX:30, blurY:30}, paused:true});

Link to comment
Share on other sites

oh, so that's it. I think I came across this same mistake before and solved it but now I just completely forgot about it. Thanks so much. I'll make sure to remember.

 

This is the same for other filters right? Thank so much. ^-^

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...