PDA

View Full Version : creating a color fade effect



sns4life
October 16th, 2003, 11:00 AM
Hi everyone!!!

Listen, I was wondering if anyone can help me out.....i am looking to create a COLOR FADE effect similar to the one on the Diesel site

http://www.diesel.com

If ANYONE knows how to go about this and can help that would be cool!

Happy Flashing!!!!

sns

Coolidge
October 16th, 2003, 01:40 PM
Welcome to the Forum!

This one is a movie clip that has a "stop();" action in the first frame of its timeline. It then has a tween that changes the tint over a period of 10 or so frames, stops on a specific frame, then ten or so more frames that returns the color to normal, leaving the movie back at frame(1).

Then in the main timeline, it has a "on(rollOver) / (rollOut)" action
that tells the movie to play to a certain frame, and on rollOut, to play the rest of the animation.

Hope that helps.

Maizoon
October 16th, 2003, 05:57 PM
Or if you'd like to script it you can:

Put a black & white version of your images on the bottom layer

Make an invisible button covering the area you want to colorize (so when you hover over the area it activates) give it a variable name of btnOne

Make a colorized version of the image, alpha it to 0, and place it on an upper layer giving it a variable name of colorOne

then put this script into your main timeline


btnOne.onRollOver = function(){
onEnterFrame = function() {
if (this.colorOne._alpha<100) {
this.colorOne._alpha += 3;
} else {
this.colorOne._alpha = 100;
delete onEnterFrame;
}
};
};
btnOne.onRollOut = function(){
onEnterFrame = function() {
if (this.colorOne._alpha>1) {
this.colorOne._alpha -= 3;
} else {
this.colorOne._alpha = 0;
delete onEnterFrame;
}
};
};


So basically whats happening is you have a colorized version of the image that cant be seen until you hover over the area, then it fades into view (thus colorizing the B&W area) and when you roll out it alpha fades to 0 (thus reverting back to B&W)

Theres probably a much easier way of doing this, but alas I am by no stretch of the imagination a guru at AS. Good luck :)