Question : adjustColorSaturation filter in AS3

Hi, me again. Googling this comes up with very little so I need to know how to use the adjustColorSaturation in AS3 (no tweening) when a user passes their mouse over a movieclip. Thanks in advance :]

Answer : adjustColorSaturation filter in AS3

You have to use ColorMatrixFilter
I suggest you look in http://livedocs.adobe.com/flex/3/langref/flash/filters/ColorMatrixFilter.html

In the following example set the saturation to blue when the mouse is over and to default when mouse is off (is better using rollover and rollout instead of mouseOver and mouseOut:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
private function onRollOver(ev:Event):void
		{
		  myMovie.filters = [new ColorMatrixFilter(this.getSaturationMatrix())];
		}
					
		private function onRollOut(ev:Event):void
		{
		   myMovie.filters = new Array(); 
		}

		private function getSaturationMatrix():Array {
		    var matrix:Array = new Array();
            matrix = matrix.concat([0, 0, 0, 0, 0]); //red array
            matrix = matrix.concat([0, 0, 0, 0, 0]); //green array
            matrix = matrix.concat([0, 0, 1, 0, 0]); //blue array
            matrix = matrix.concat([0, 0, 0, 1, 0]); 
            return matrix;
		}
Random Solutions  
 
programming4us programming4us