UNI [SITE + MOTION] – FLASH BUTTON OVER STATES

May 16th, 2009 | Richard Almond

This problem had been annoying me for a while – how can you get a button to fade from one state to another on roll over, and then back to its original state on roll out. I tried various methods, but all either consisted of having the button temporarily at its over state when the animation is first loaded, or the button jumping to its over state if the mouse is removed from the button before the full fade has finished playing.

It turns out some ActionScripting is required. You basically need to set up a few variables to tell the button to start increasing its alpha value on roll over, and start decreasing it on roll out. This way if the mouse is moved away from the button when it is say 50% through its fade, the button will begin to fade back out from that exact point.

Here’s an example:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog Directory for Lanarkshire