Jump to content
Search Community

colorMatrixFilter and Flash IDE

mmiller64 test
Moderator Tag

Recommended Posts

I'm trying to replicate a Flash CS4 IDE filter setting (specifically, saturation = 14 and hue = -137) with colorMatrixFilter but just can't get it. Your post "Explanation of more advanced tweenMax features" seems to address my problem but I don't understand the explanation. Could you elaborate or specifically tell me how to achieve the above settings with tweenMax?

 

Thanks,

Mack

Link to comment
Share on other sites

You just need to set the values in the IDE and then figure out the exact matrix values with ActionScript like:

 

function getMatrix(mc:DisplayObject):Array {
var i:int = mc.filters.length;
while (--i > -1) {
	if (mc.filters[i] is ColorMatrixFilter) {
		return ColorMatrixFilter(mc.filters[i]).matrix;
	}
}
return null;
}

var matchingMatrix:Array = getMatrix(mc);

//then to tween to those values, do:
TweenMax.to(otherObject, 2, {colorMatrixFilter:{matrix:matchingMatrix}});

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...