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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

scale (métho<strong>de</strong> Matrix.scale)<br />

public scale(sx:Number, sy:Number) : Void<br />

Modifie une matrice <strong>de</strong> façon à ce qu'elle redimensionne l'image à laquelle elle est appliquée.<br />

Sur l'image redimensionnée, l'emplacement <strong>de</strong> chaque pixel sur l'axe x est multiplié par sx ;<br />

sur l'axe y, il est multiplié par sy.<br />

La métho<strong>de</strong> scale() modifie les propriétés a et d <strong>de</strong> l'objet Matrix. Dans la notation <strong>de</strong>s<br />

matrices, ceci est illustré comme suit :<br />

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

Paramètres<br />

sx:Number - Un multiplicateur utilisé pour redimensionner l'objet sur l'axe x.<br />

sy:Number - Un multiplicateur utilisé pour redimensionner l'objet sur l'axe y.<br />

Exemple<br />

L'exemple suivant utilise la métho<strong>de</strong> scale() pour redimensionner myMatrix en appliquant<br />

un facteur <strong>de</strong> 3 à l'horizontale et un facteur <strong>de</strong> 4 à la verticale.<br />

import flash.geom.Matrix;<br />

var myMatrix:Matrix = new Matrix(2, 0, 0, 2, 100, 100);<br />

trace(myMatrix.toString()); // (a=2, b=0, c=0, d=2, tx=100, ty=100)<br />

myMatrix.scale(3, 4);<br />

trace(myMatrix.toString()); // (a=6, b=0, c=0, d=8, tx=300, ty=400)<br />

toString (métho<strong>de</strong> Matrix.toString)<br />

public toString() : String<br />

Renvoie une valeur <strong>de</strong> texte donnant la liste <strong>de</strong>s propriétés <strong>de</strong> l'objet Matrix.<br />

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

804 Chapitre 2: Classes <strong>ActionScript</strong>

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

Saved successfully!

Ooh no, something went wrong!