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.

contents of the parent no<strong>de</strong> are:<br />

morton<br />

good&evil<br />

Voir également<br />

appendChild (XMLNo<strong>de</strong>.appendChild, métho<strong>de</strong>), insertBefore<br />

(XMLNo<strong>de</strong>.insertBefore, métho<strong>de</strong>), removeNo<strong>de</strong> (XMLNo<strong>de</strong>.removeNo<strong>de</strong>, métho<strong>de</strong>),<br />

XML<br />

prefix (XMLNo<strong>de</strong>.prefix, propriété)<br />

public prefix : String [lecture seule]<br />

Le préfixe <strong>du</strong> nom <strong>de</strong> nœud XML. Par exemple, le préfixe « contact » <strong>du</strong> nœud<br />

bob@example.com et le nom local « mailbox »,<br />

ce qui forme « contact.mailbox ».<br />

La propriété no<strong>de</strong>Name d'un objet nœud XML renvoie le nom complet (ce qui inclut le<br />

préfixe et le nom local). Vous pouvez accé<strong>de</strong>r à la section locale <strong>du</strong> nom <strong>de</strong> l'élément par<br />

l'intermédiaire <strong>de</strong> la propriété localName.<br />

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

Exemple<br />

Un répertoire contient un fichier SWF et un fichier XML. Le fichier XML, appelé<br />

« SoapSample.xml » contient le co<strong>de</strong> suivant :<br />

<br />

<br />

<br />

<br />

San Francisco<br />

<br />

<br />

<br />

La source <strong>du</strong> fichier SWF contient le script suivant (remarquez les commentaires précisant les<br />

chaînes renvoyées) :<br />

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

xmlDoc.ignoreWhite = true;<br />

xmlDoc.load("SoapSample.xml");<br />

xmlDoc.onLoad = function(success:Boolean)<br />

{<br />

var tempNo<strong>de</strong>:XMLNo<strong>de</strong> = xmlDoc.childNo<strong>de</strong>s[0].childNo<strong>de</strong>s[0].childNo<strong>de</strong>s[0];<br />

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

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

Saved successfully!

Ooh no, something went wrong!