Fading an image

How do you fade a graphic on mouseover, and then have the graphic return to its original alpha on mouseout?

Basically what I want to do is have the graphic fade to around 50% alpha on mouseover and then fade back to 100% alpha on mouseout.

I am really stuck on this, any help is appreciated.

Thanks :slight_smile:

put the graphic into a MC, and put this AS on the MC…
[AS]
onClipEvent (load) {
this._alpha = 100;
}
onClipEvent (enterFrame) {
function fadeOut() {
if (this._alpha>50) {
this._alpha -= 10;
} else {
this.onEnterFrame = null;
}
}
function fadeIn() {
if (this._alpha<100) {
this._alpha += 10;
} else {
this.onEnterFrame = null;
}
}
this.onRollOver = function() {
this.onEnterFrame = fadeOut;
};
this.onRollOut = function() {
this.onEnterFrame = fadeIn;
};
}
[/AS]

Thanks, worked great! :slight_smile: