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.

output:<br />

// <br />

// <br />

// <br />

L'exemple suivant provient <strong>du</strong> fichier FLA XML_languagePicker FLA situé dans le répertoire<br />

Examples. Vous pouvez le trouver dans la définition <strong>de</strong> fonction <strong>de</strong> gestionnaire<br />

d'événements, languageXML.onLoad :<br />

// loop through the strings in each language no<strong>de</strong><br />

// adding each string as a new element in the language array<br />

for (var stringNo<strong>de</strong>:XMLNo<strong>de</strong> = childNo<strong>de</strong>.firstChild; stringNo<strong>de</strong> != null;<br />

stringNo<strong>de</strong> = stringNo<strong>de</strong>.nextSibling, j++) {<br />

masterArray[i][j] = stringNo<strong>de</strong>.firstChild.no<strong>de</strong>Value;<br />

}<br />

Pour afficher l'ensemble <strong>du</strong> script, ouvrez le fichier XML_languagePicker.fla situé dans le<br />

dossier <strong>ActionScript</strong> :<br />

■ Windows : lecteur d'amorçage\Program Files\Macromedia\Flash 8\Samples and<br />

Tutorials\Samples\<strong>ActionScript</strong><br />

■ Macintosh : disque <strong>du</strong>r Macintosh/Applications/Macromedia Flash 8/Samples and<br />

Tutorials/Samples/<strong>ActionScript</strong><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 />

getNamespaceForPrefix<br />

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

public getNamespaceForPrefix(prefix:String) : String<br />

Renvoie l'URI d'espace <strong>de</strong> nom qui est associée au préfixe spécifié pour le nœud. Pour fixer<br />

l'URI, getPrefixForNamespace() remonte la hiérarchie XML <strong>de</strong>puis le nœud, si nécessaire,<br />

et renvoie l'URI <strong>de</strong> l'espace <strong>de</strong> nom <strong>de</strong> la première déclaration xmlns <strong>du</strong> prefix donné.<br />

Si aucun espace <strong>de</strong> nom n'est défini pour ledit préfixe, la métho<strong>de</strong> renvoie null.<br />

Si vous spécifiez une chaîne vi<strong>de</strong> ("") en tant que prefix et que ce nœud a un espace <strong>de</strong> nom<br />

par défaut (par exemple xmlns="http://www.example.com/"), la métho<strong>de</strong> renvoie cet URI<br />

d'espace <strong>de</strong> nom.<br />

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

Paramètres<br />

prefix:String - Préfixe pour lequel la métho<strong>de</strong> renvoie le nom d'espace associé.<br />

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

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

Saved successfully!

Ooh no, something went wrong!