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.

Opérateur ^= (affectation XOR au niveau <strong>du</strong> bit)<br />

expression1 ^= expression2<br />

Affecte à expression1 la valeur <strong>de</strong> expression1 ^ expression2. Par exemple, les <strong>de</strong>ux<br />

instructions suivantes sont équivalentes :<br />

x ^= y;<br />

x = x ^ y;<br />

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

Opéran<strong>de</strong>s<br />

expression1 : Number - Entiers et variables.<br />

expression2 : Number - Entiers et variables.<br />

Valeur renvoyée<br />

Number - Résultat <strong>de</strong> l'opération au niveau <strong>du</strong> bit.<br />

Exemple<br />

L'exemple suivant illustre l'opération (^=) d'affectation XOR au niveau <strong>du</strong> bit :<br />

// 15 <strong>de</strong>cimal = 1111 binary<br />

var x:Number = 15;<br />

// 9 <strong>de</strong>cimal = 1001 binary<br />

var y:Number = 9;<br />

trace(x ^= y); // returns 6 <strong>de</strong>cimal (0110 binary)<br />

Voir également<br />

& Opérateur AND au niveau <strong>du</strong> bit, &= Opérateur d'affectation AND au niveau <strong>du</strong><br />

bit, Opérateur ^ (XOR au niveau <strong>du</strong> bit), | Opérateur OR au niveau <strong>du</strong> bit, |=<br />

Opérateur d'affectation OR au niveau <strong>du</strong> bit, ~ Opérateur NOT au niveau <strong>du</strong> bit<br />

Opérateur /*..*/ (séparateur <strong>de</strong> commentaires <strong>de</strong><br />

bloc)<br />

/* comment */<br />

/* comment<br />

comment */<br />

Opérateurs 157

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

Saved successfully!

Ooh no, something went wrong!