Computer Science Canada

Fading Buttons

Author:  TheZsterBunny [ Thu Feb 26, 2004 7:13 pm ]
Post subject:  Fading Buttons


I've been using flash for years (started with flash 3) but I've never been very good at it.

I am trying to make some buttons with fading borders, in the manner of you roll over the buttons, the border fades in, you roll off of the buttons the border fades out. So far, this is simple, however I need to know how to do the following. If someone rolls off of the button while the glow is still appearing, remove the glow from that point.

I'm not sure if I've made that clear or not, but any help would be appreciated (flash mx 2004)


Author:  Delta [ Fri Feb 27, 2004 11:08 pm ]
Post subject: 

well maybe you should show us that you can fade the borders like you wanted... then maybe we can help you with the rest... otherwise.. its pretty much us doing all the work for you Confused which is just stupid

Author:  zylum [ Sat Feb 28, 2004 2:03 am ]
Post subject: 

is this what youre looking for???

Author:  TheZsterBunny [ Sun Feb 29, 2004 8:42 pm ]
Post subject:  Re: Fade

Zylum, thank you. This is exactly what I was trying to do. It's pretty difficult to explain what I meant.

its pretty much us doing all the work for you

Delta, I guarantee you that this one button is not all the work being done. I plan on putting together a nice movie, and these buttons are a bonus.


Author:  TheZsterBunny [ Sun Feb 29, 2004 9:03 pm ]
Post subject: 

Smile This one year in turing has helped me to understand actionscript. I can understand what you did there (which is a great accomplishment for me).

Thanks, and I hope that this didn't take too much time from you.


Author:  TheZsterBunny [ Mon Mar 01, 2004 5:00 pm ]
Post subject:  Thanks, but

I have been fiddling with the file for the last day, but I have been unable to figure out a way in which to assign other actions to the buttons (i.e. do something). I have dropped an invisible button into the movie clips and have tried assigning them actions from there. no go. What do you recommend?


Author:  zylum [ Mon Mar 01, 2004 5:10 pm ]
Post subject: 

what do you mean by "other actions"

if you mean if the button is clicked goto the next frame then this will work:


MovieClip.prototype.buttonActions = function(hSpd, fSpd) {
        this.high._alpha = 0;
        this.onEnterFrame = function() {
                if (this.hitTest(_xmouse, _ymouse, true)) {
                        this.onMouseDown = function() {
                        this.high._alpha -= (this.high._alpha-100)/hSpd;
                } else {
                        this.high._alpha -= (this.high._alpha-0)/fSpd;
button.buttonActions(10, 7);


Author:  TheZsterBunny [ Mon Mar 01, 2004 7:01 pm ]
Post subject: 

Nice, I can use that, but would changing frames within the button movie clip be possible? (i.e. change color when clicked)

Sorry for being a nuisance


Author:  Homer_simpson [ Mon Mar 01, 2004 9:04 pm ]
Post subject: 

i dunno why he's used all that action script forsomething as simple as that... here's how i did it...

Author:  zylum [ Mon Mar 01, 2004 9:37 pm ]
Post subject: 

maybe i shouldnt have given him that actionscript... it's a bit advanced, but it's really usefull for more advanced effects and the prototype can make it really easy to add extra buttons with the same actions... i guess for someone new to flash should stick with simple buttons....

Author:  TheZsterBunny [ Mon Mar 01, 2004 9:46 pm ]
Post subject: 

Yeah, its annoying, but next (school) year, i'm taking a class.

Homer, this actionscript allows the fade to change direction in mid animation. If you take a look at the one you submitted, and rollover and off the button very quickly, a black border will suddenly appear.

This one, and the actionscript found here does not.

Author:  zylum [ Mon Mar 01, 2004 9:50 pm ]
Post subject: 

what exactly is it that you are looking for? maybe i can help

Author:  TheZsterBunny [ Wed Mar 03, 2004 12:26 pm ]
Post subject:  Buttons

The ultimate goal of these buttons is the following:

all buttons : fading mouseover, change color on click.

button 1: loading bar until movie complete, fades out after released, moves to second scene and starts playing music and the rest of the film.

button 2: fades out when released, follows a link 5 seconds later.

*sigh* i've been trying it, and it should be alot easier than it is.

Author:  The_Triangle [ Mon Nov 28, 2005 4:09 pm ]
Post subject: 

that looks terrible.