Flash CS4 ActionScript 3.0 and TweenMax: Random Tint / Color Tween

by carl schooff on August 11, 2010 · View Comments

in GreenSock Tweening Platform Tips

This movie requires Flash Player 9

Check out this awesome and easy technique to tween a movie clip’s color. Use just one line of code instead of ActionScript’s clunky colorTransform object. Towards the end we will investigate tweening to a random color as well.

If you need help getting started with TweenMax be sure to read:
Introduction to TweenMax for Beginners

Let me know what you think in the comments below. Are you loving TweenMax yet?

Post to Twitter Post to Facebook

  • DGates

    Hi Carl,
    TweenMax is king! I was just wondering if it is just as easy to apply a partial tint the same way or a similar way. For example tint the whole car movieclip 50% green on rollover etc.
    Cheers

  • DGates

    Aha! Nevermind, I figured it out…

    import com.greensock.plugins.TweenPlugin; 
    import com.greensock.plugins.ColorMatrixFilterPlugin; 
    TweenPlugin.activate([ColorMatrixFilterPlugin]);

    gti_mc.addEventListener(MouseEvent.MOUSE_OVER, tweenGreen);function tweenGreen(mE:MouseEvent):void { TweenMax.to(gti_mc, 1, {colorMatrixFilter:{colorize:0x00FF00, amount:0.5}});}

    Sorry for wasting space, just thought I’d post this snippet in case someone else was wondering the same thing as me.

  • http://www.snorkl.tv/ carl schooff

    Good job. You beat me too it! Thanks for posting your solution. I’m sure it will serve to help others.

    Have a great day.

    Carl

blog comments powered by Disqus

Previous post:

Next post: