Jump to content
GreenSock

danee987

Can't remove colorize (ColorMatrixFilter)

Recommended Posts

Hoping someone could help me. I'm not sure what I'm doing wrong but I have two functions. One to tint(colorize) a movieclip and one to supposedly remove the color effect that was added. The object changes color as expected. But when I try to remove the color it doesn't work. In the function below I have the amount set to 0 on the tintRemove function but I ALSO tried setting the time to 0 on the tintRemove function and setting the remove property to true so that it would supposedly remove the effect but it still does not. I made sure my tintRemove function was being called. Also if I just try a regular tint inside that function it works fine. It just doesn't want to remove and reset my clip to its original look:( How can I remove the color effect I had added to the object? What am I doing wrong? :roll:

 



public function tint($d:DisplayObject, $c:Number=0x00ffff, $amount:Number=1, $animated:Boolean = true, $index:Number=0):TweenMax {

		var $time:Number = .2;
		 if (!$animated) $time = 0;

		return TweenMax.to($d, $time, {index:$index, colorMatrixFilter:{colorize:$c, amount:$amount} } );

}


public function tintRemove($d:DisplayObject):TweenMax {


		return TweenMax.to($d, .2, {colorMatrixFilter:{colorize:0x00ffff, amount:0} } );

}






Link to comment
Share on other sites

nothing is jumping out at me as being wrong.

 

i did a simplified approach of running 2 consecutive tweens

 

TweenMax.to(mc, 1, {colorMatrixFilter:{colorize:0xff0000, amount:1}});

 

 

TweenMax.to(mc, 1, {colorMatrixFilter:{ amount:0}, delay:1.2});

 

and it worked fine as shown and also when i had the colorize prop in the second tween.

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.
×