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.

Valeur renvoyée<br />

Array - Tableau <strong>de</strong> noms <strong>de</strong> style (en tant que chaînes).<br />

Exemple<br />

Cet exemple crée un nom d'objet StyleSheet styleSheet qui contient <strong>de</strong>ux styles, heading et<br />

bodyText. Il appelle ensuite la métho<strong>de</strong> getStyleNames() <strong>de</strong> l'objet StyleSheet, place les<br />

résultats dans le tableau names_array et affiche le contenu <strong>du</strong> tableau dans le panneau <strong>de</strong><br />

sortie.<br />

import TextField.StyleSheet;<br />

var my_styleSheet:StyleSheet = new StyleSheet();<br />

my_styleSheet.setStyle("heading", {fontsize:'24px'});<br />

my_styleSheet.setStyle("bodyText", {fontsize:'12px'});<br />

var names_array:Array = my_styleSheet.getStyleNames();<br />

trace(names_array.join("\n"));<br />

Les informations suivantes apparaissent dans le panneau <strong>de</strong> sortie :<br />

bodyText<br />

heading<br />

Voir également<br />

getStyle (métho<strong>de</strong> StyleSheet.getStyle)<br />

load (métho<strong>de</strong> StyleSheet.load)<br />

public load(url:String) : Boolean<br />

Procè<strong>de</strong> au chargement <strong>du</strong> fichier CSS dans la StyleSheet. L'opération <strong>de</strong> chargement est<br />

asynchrone : utilisez le gestionnaire <strong>de</strong> rappel onLoad() pour déterminer si le chargement <strong>du</strong><br />

fichier est terminé. Le fichier CSS doit rési<strong>de</strong>r dans le même domaine que le fichier SWF qui<br />

le charge.<br />

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

Paramètres<br />

url:String - URL <strong>du</strong> fichier CSS à charger. L'URL doit se trouver dans le même domaine<br />

que l'URL <strong>du</strong> fichier SWF.<br />

Valeur renvoyée<br />

Boolean - false si aucun paramètre (null) n'est transmis ; true dans tous les autres cas.<br />

Utilisez le gestionnaire <strong>de</strong> rappel onLoad() pour vérifier si le chargement d'une StyleSheet a<br />

réussi.<br />

StyleSheet (TextField.StyleSheet) 1189

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

Saved successfully!

Ooh no, something went wrong!