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.

var <strong>de</strong>grees:Number = 45;<br />

var radians:Number = (<strong>de</strong>grees/180) Math.PI;<br />

myMatrix.b = radians;<br />

trace(myMatrix.b); // 0.785398163397448<br />

c (propriété Matrix.c)<br />

public c : Number<br />

Dans la <strong>de</strong>uxième ligne et la première colonne <strong>de</strong> l'objet Matrix, la valeur affectant le<br />

positionnement <strong>de</strong>s pixels sur l'axe x lors <strong>de</strong> la rotation ou <strong>de</strong> l'inclinaison d'une image.<br />

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

Exemple<br />

L'exemple suivant crée l'objet Matrix myMatrix et définit sa valeur c.<br />

import flash.geom.Matrix;<br />

var myMatrix:Matrix = new Matrix();<br />

trace(myMatrix.c); // 0<br />

var <strong>de</strong>grees:Number = 45;<br />

var radians:Number = (<strong>de</strong>grees/180) Math.PI;<br />

myMatrix.c = radians;<br />

trace(myMatrix.c); // 0.785398163397448<br />

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

public clone() : Matrix<br />

Renvoie un nouvel objet Matrix, clone <strong>de</strong> cette matrice, avec une copie exacte <strong>de</strong> l'objet<br />

contenu.<br />

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

Renvoie<br />

flash.geom.Matrix - Un objet Matrix.<br />

Exemple<br />

L'exemple suivant crée la variable clonedMatrix à partir <strong>de</strong> la variable myMatrix. La classe<br />

Matrix ne dispose pas <strong>de</strong> métho<strong>de</strong> equals ; par conséquent, l'exemple suivant utilise une<br />

fonction écrite personnalisée pour tester l'égalité <strong>de</strong> <strong>de</strong>ux matrices.<br />

import flash.geom.Matrix;<br />

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

Matrix (flash.geom.Matrix) 791

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

Saved successfully!

Ooh no, something went wrong!