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.

eval ("var" + i) = "first";<br />

par :<br />

this["var"+i] = "first"<br />

ou par :<br />

set ("var" + i, "first");<br />

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

Paramètres<br />

expression:Object - Le nom d'une variable, d'une propriété, d'un objet ou d'un clip à<br />

extraire. Ce paramètre peut être <strong>de</strong> type String ou une référence directe à l'occurrence d'objet<br />

(les guillemets (" ") sont facultatifs.)<br />

Renvoie<br />

Object - Une valeur, une référence à un objet ou un clip, ou un<strong>de</strong>fined.<br />

Exemple<br />

L'exemple suivant utilise eval() pour définir les propriétés <strong>de</strong>s clips nommés <strong>de</strong> façon<br />

dynamique. Ce co<strong>de</strong> <strong>ActionScript</strong> définit la propriété _rotation <strong>de</strong> trois clips intitulés<br />

square1_mc, square2_mc et square3_mc.<br />

for (var i = 1; i

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

Saved successfully!

Ooh no, something went wrong!