03.07.2013 Views

Guide de reference du langage ActionScript 2.0 - PowWeb

Guide de reference du langage ActionScript 2.0 - PowWeb

Guide de reference du langage ActionScript 2.0 - PowWeb

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

matrix (propriété ColorMatrixFilter.matrix)<br />

public matrix : Array<br />

Un tableau <strong>de</strong> 20 éléments pour la transformation <strong>de</strong> couleurs 4 x 5.<br />

Disponibilité : <strong>ActionScript</strong> 1.0 ; Flash Player 8<br />

Exemple<br />

L'exemple suivant crée une nouvelle occurrence <strong>de</strong> ColorMatrixFilter et ensuite change sa<br />

propriété matrix. La propriété matrix ne peut pas être changée directement en modifiant sa<br />

valeur (par exemple, clonedFilter.matrix[2] = 1;). Vous <strong>de</strong>vez plutôt donner une<br />

référence au tableau, effectuer le changement <strong>de</strong> la référence, et restaurer la valeur en utilisant<br />

clonedFilter.matrix = changedMatrix.<br />

import flash.filters.ColorMatrixFilter;<br />

var matrix:Array = new Array();<br />

matrix = matrix.concat([1, 0, 0, 0, 0]); // red<br />

matrix = matrix.concat([0, 1, 0, 0, 0]); // green<br />

matrix = matrix.concat([0, 0, 1, 0, 0]); // blue<br />

matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha<br />

var filter:ColorMatrixFilter = new ColorMatrixFilter(matrix);<br />

trace("filter: " + filter.matrix);<br />

var changedMatrix:Array = filter.matrix;<br />

changedMatrix[2] = 1;<br />

filter.matrix = changedMatrix;<br />

trace("filter: " + filter.matrix);<br />

ColorTransform<br />

(flash.geom.ColorTransform)<br />

Object<br />

|<br />

+-flash.geom.ColorTransform<br />

public class ColorTransform<br />

extends Object<br />

La classe ColorTransform vous permet <strong>de</strong> régler <strong>de</strong> façon mathématique l'ensemble <strong>de</strong>s<br />

valeurs <strong>de</strong> couleur dans un clip. La fonction <strong>de</strong> réglage <strong>de</strong>s couleurs ou transformation <strong>de</strong><br />

couleur peut être appliquée aux quatre canaux : rouge, vert, bleu et transparence alpha.<br />

ColorTransform (flash.geom.ColorTransform) 445

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!