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.

Dans cet exemple, la propriété idMap <strong>de</strong> cet objet XML est un Objet avec trois propriétés : 41,<br />

42 et IT. Chacune <strong>de</strong> ces propriétés est un XMLNo<strong>de</strong> avec la valeur id correspondante. Par<br />

exemple, la propriété IT <strong>de</strong> l'objet idMap est ce nœud :<br />

<br />

Information Technology<br />

<br />

Vous <strong>de</strong>vez utiliser la métho<strong>de</strong> parse() sur l'objet XML pour la propriété idMap à être<br />

instancié.<br />

Si plus d'un XMLNo<strong>de</strong> a la même valeur id, la propriété correspondante <strong>de</strong> l'objet idNo<strong>de</strong> est<br />

celle <strong>du</strong> <strong>de</strong>rnier nœud analysé, <strong>de</strong> la manière suivante :<br />

var x1:XML = new XML("");<br />

x2 = new XML();<br />

x2.parseXML(x1);<br />

trace (x2.idMap['1']);<br />

L'exemple suivant donnera en sortie le nœud :<br />

<br />

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

Exemple<br />

Vous pouvez créer un texte fichier nommé idMapTest.xml contenant le texte suivant .<br />

<br />

<br />

<br />

Virtual Library<br />

<br />

<br />

See what's<br />

new!<br />

Check out the hot picks of the day!<br />

<br />

<br />

Hot Pick #1<br />

<br />

<br />

Hot Pick #2<br />

<br />

1340 Chapitre 2: Classes <strong>ActionScript</strong>

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

Saved successfully!

Ooh no, something went wrong!