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.

width (propriété Rectangle.width)<br />

public width : Number<br />

La largeur <strong>de</strong> l'objet rectangle en pixels. La modification <strong>de</strong> la valeur <strong>de</strong> la propriété width<br />

d'un objet Rectangle n'a pas d'effet sur les propriétés x, y et height.<br />

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

Exemple<br />

L'exemple suivant crée un objet Rectangle et modifie sa propriété width (largeur) en la faisant<br />

passer <strong>de</strong> 10 à 20. La valeur <strong>de</strong> rect.right est également modifiée.<br />

import flash.geom.Rectangle;<br />

var rect:Rectangle = new Rectangle(5, 5, 10, 10);<br />

trace(rect.width); // 10<br />

trace(rect.right); // 15<br />

rect.width = 20;<br />

trace(rect.width); // 20<br />

trace(rect.right); // 25<br />

Voir également<br />

x (propriété Rectangle.x), y (propriété Rectangle.y), height (propriété<br />

Rectangle.height)<br />

x (propriété Rectangle.x)<br />

public x : Number<br />

La coordonnée x <strong>du</strong> coin supérieur gauche <strong>du</strong> rectangle. La modification <strong>de</strong> la valeur <strong>de</strong> la<br />

propriété x d'un objet Rectangle n'a pas d'effet sur les propriétés y, width et height.<br />

La propriété x est égale à la propriété left.<br />

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

Rectangle (flash.geom.Rectangle) 1089

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

Saved successfully!

Ooh no, something went wrong!