ColorMatrixFilter (flash.filters.ColorMatrixFilter)
425
listener.image = image;
listener.onMouseMove = function() {
var xPercent:Number = 1 - (_xmouse/Stage.width);
var yPercent:Number = 1 - (_ymouse/Stage.height);
var matrix:Array = new Array();
matrix = matrix.concat([yPercent, 0, 0, 0, 0]); // red
matrix = matrix.concat([0, xPercent, 0, 0, 0]); // green
matrix = matrix.concat([0, 0, xPercent, 0, 0]); // blue
matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha
var filter:BitmapFilter = new ColorMatrixFilter(matrix);
image.filters = new Array(filter);
}
Mouse.addListener(listener);
listener.onMouseMove();
See also
getPixel (BitmapData.getPixel method)
,
applyFilter (BitmapData.applyFilter
method)
,
filters (MovieClip.filters property)
,
cacheAsBitmap
(MovieClip.cacheAsBitmap property)
Property summary
Properties inherited from class Object
Constructor summary
Modifiers
Property
Description
matrix
:Array
An array of 20 elements for 4 x 5 color transform.
constructor (Object.constructor property)
,
__proto__ (Object.__proto__
property)
,
prototype (Object.prototype property)
,
__resolve
(Object.__resolve property)
Signature
Description
ColorMatrixFilter
(ma
trix:Array)
Initializes a new ColorMatrixFilter instance with the specified
parameters.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...