Posted By

burnandbass on 04/22/11


Tagged


Versions (?)

Tween any DisplayObject to Black and White, or from Black&White to Color


 / Published in: ActionScript 3
 

URL: tween, black, white,

I'm going to use TweenLite for this;

We need to import the ColorMatrixFilterPlugin and register it

  1. //Tweens to black and white
  2. TweenLite.to(DisplayObjectYouWantToTween ,1,{colorMatrixFilter:{matrix:[0.3,0.59,0.11,0, 0,0.3,0.59,0.11,0,0,0.3,0.59,0.11,0,0,0,0,0,1,0]}});
  3.  
  4. //Tween from black and white to Color
  5. TweenLite.to(DisplayObjectYouWantToTween,1,{colorMatrixFilter:{matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]}});
  6.  
  7.  
  8. /*
  9. Note you need to import TweenLite's ColorMatrixFilterPlugin and register it :)
  10. */

Report this snippet  

You need to login to post a comment.