Here’s a neat little effect that nicely touches on many of the concepts we’ve been discussing: Basic TweenMax Tweens, Using Plugins, Event Listeners and the allTo() Method. Take a look at a streamlined way to apply nifty rollover and rollout effects with ease.
ActionScript 3.0 Code Used in this Video:
import com.greensock.*;
import com.greensock.easing.*;
nav_mc.buttonMode = true;
nav_mc.addEventListener(MouseEvent.MOUSE_OVER, personOver);
nav_mc.addEventListener(MouseEvent.MOUSE_OUT, personOut);
function personOver(e:MouseEvent):void{
var currentMC:MovieClip = MovieClip(e.target);
TweenMax.to(currentMC, .3, {colorMatrixFilter:{saturation:1, brightness:1}});
TweenMax.to(currentMC, 1, {glowFilter:{color:0xffff00, alpha:1, blurX:10, blurY:10}});
}
function personOut(e:MouseEvent):void{
var currentMC:MovieClip = MovieClip(e.target);
TweenMax.to(currentMC, 1, {colorMatrixFilter:{saturation:.1, brightness:.5}});
TweenMax.to(currentMC, 1, {glowFilter:{color:0xffff00, alpha:0, blurX:10, blurY:10}});
}
var dudes_arr:Array = new Array(nav_mc.miles_mc, nav_mc.hurley_mc, nav_mc.sawyer_mc);
TweenMax.allTo(dudes_arr, 1,
{colorMatrixFilter:{saturation:.1, brightness:.5}, delay:1, repeat:-1, yoyo:true}, 1)
Learn More:
Be sure to check out my As3 GrowAndColorizeItem custom AS3 class for a very easy to use and neat grayscale to color effect.
Resources Mentioned in this Video:
Learn about eventListeneres and target vs currentTarget
Official GreenSock TweenMax Source and Documentation
Download Files Used in This Video
SNORKL-TV_desaturate: Flash CS3
Take Action
Got something to say? Comment below, or give me a hand by promoting this tutorial on your favorite social network. Thanks!






