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.

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

Valeur renvoyée<br />

flash.geom.Rectangle - Nouvel objet Rectangle avec les mêmes valeurs que l'objet<br />

Rectangle d'origine pour les propriétés x, y, width (largeur) et height (hauteur).<br />

Exemple<br />

L'exemple suivant crée trois objets Rectangle et les compare. rect_1 est créé à l'ai<strong>de</strong> <strong>du</strong><br />

constructeur <strong>de</strong> rectangle. rect_2 est créé en lui définissant <strong>de</strong>s valeurs égales à celles <strong>du</strong><br />

rect_1. Enfin, clonedRect est créé par clonage <strong>du</strong> rect_1. Remarque : Alors que le rect_2<br />

est évalué comme étant égal au rect_1, ce n'est pas le cas pour le clonedRect, même si ce<br />

<strong>de</strong>rnier contient les même valeurs que le rect_1.<br />

import flash.geom.Rectangle;<br />

var rect_1:Rectangle = new Rectangle(1, 2, 4, 8);<br />

var rect_2:Rectangle = rect_1;<br />

var clonedRect:Rectangle = rect_1.clone();<br />

trace(rect_1 == rect_2); // true<br />

trace(rect_1 == clonedFilter); // false<br />

for(var i in rect_1) {<br />

trace(">> " + i + ": " + rect_1[i]);<br />

>> toString: [type Function]<br />

>> equals: [type Function]<br />

>> union: [type Function]<br />

>> intersects: [type Function]<br />

>> intersection: [type Function]<br />

>> containsRectangle: [type Function]<br />

>> containsPoint: [type Function]<br />

>> contains: [type Function]<br />

>> offsetPoint: [type Function]<br />

>> offset: [type Function]<br />

>> inflatePoint: [type Function]<br />

>> inflate: [type Function]<br />

>> size: (x=4, y=8)<br />

>> bottomRight: (x=5, y=10)<br />

>> topLeft: (x=1, y=2)<br />

>> bottom: 10<br />

>> top: 2<br />

>> right: 5<br />

>> left: 1<br />

>> isEmpty: [type Function]<br />

>> setEmpty: [type Function]<br />

>> clone: [type Function]<br />

>> height: 8<br />

Rectangle (flash.geom.Rectangle) 1071

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

Saved successfully!

Ooh no, something went wrong!