EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Page 425

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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.

Table of Contents

Related product manuals