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.

Exemple<br />

L'exemple suivant crée un objet Rectangle vi<strong>de</strong> et vérifie qu'il est vi<strong>de</strong>.<br />

import flash.geom.*;<br />

var rect:Rectangle = new Rectangle(1, 2, 0, 0);<br />

trace(rect.toString()); // (x=1, y=2, w=0, h=0)<br />

trace(rect.isEmpty()); // true<br />

L'exemple suivant crée un Rectangle non vi<strong>de</strong> puis le vi<strong>de</strong>.<br />

import flash.geom.Rectangle;<br />

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

trace(rect.isEmpty()); // false<br />

rect.width = 0;<br />

trace(rect.isEmpty()); // true<br />

rect.width = 4;<br />

trace(rect.isEmpty()); // false<br />

rect.height = 0;<br />

trace(rect.isEmpty()); // true<br />

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

public left : Number<br />

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

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

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

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

Exemple<br />

L'exemple suivant modifie la propriété left, la faisant passer <strong>de</strong> 0 à 10. Notez que rect.x est<br />

également modifiée.<br />

import flash.geom.Rectangle;<br />

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

trace(rect.left); // 0<br />

trace(rect.x); // 0<br />

Rectangle (flash.geom.Rectangle) 1081

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

Saved successfully!

Ooh no, something went wrong!