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.

Modificateurs Signature Description<br />

static sqrt(x:Number) :<br />

Number<br />

static tan(x:Number) :<br />

Number<br />

Métho<strong>de</strong>s héritées <strong>de</strong> la classe Object<br />

abs (métho<strong>de</strong> Math.abs)<br />

statique publique abs(x:Number) : Number<br />

Calcule et renvoie une valeur absolue pour le nombre spécifié par le paramètre x.<br />

Disponibilité : <strong>ActionScript</strong> 1,0 ; Flash Player 5<br />

Paramètres<br />

x:Number - Un nombre.<br />

Renvoie<br />

Number - Un nombre.<br />

Exemple<br />

L'exemple suivant illustre la façon dont la métho<strong>de</strong> Math.abs() renvoie la valeur absolue<br />

d'un nombre sans affecter la valeur <strong>du</strong> paramètre x (intitulé num dans cet exemple) :<br />

var num:Number = -12;<br />

var numAbsolute:Number = Math.abs(num);<br />

trace(num); // output: -12<br />

trace(numAbsolute); // output: 12<br />

acos (métho<strong>de</strong> Math.acos)<br />

statique publique acos(x:Number) : Number<br />

Calcule et renvoie l'arc cosinus <strong>du</strong> nombre spécifié dans le paramètre x, en radians.<br />

770 Chapitre 2: Classes <strong>ActionScript</strong><br />

Calcule et renvoie la racine carrée <strong>du</strong> nombre spécifié.<br />

Calcule et renvoie la tangente <strong>de</strong> l'angle spécifié.<br />

addProperty (métho<strong>de</strong> Object.addProperty), hasOwnProperty (métho<strong>de</strong><br />

Object.hasOwnProperty), isPropertyEnumerable (métho<strong>de</strong><br />

Object.isPropertyEnumerable), isPrototypeOf (métho<strong>de</strong> Object.isPrototypeOf),<br />

registerClass (métho<strong>de</strong> Object.registerClass), toString (métho<strong>de</strong><br />

Object.toString), unwatch (métho<strong>de</strong> Object.unwatch), valueOf (métho<strong>de</strong><br />

Object.valueOf), watch (métho<strong>de</strong> Object.watch)

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

Saved successfully!

Ooh no, something went wrong!