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.

htmlText (propriété TextField.htmlText)<br />

public htmlText : String<br />

Si le champ texte est un champ texte HTML, cette propriété contient la représentation<br />

HTML <strong>du</strong> contenu <strong>du</strong> champ texte. Si le champ texte n'est pas un champ texte HTML, son<br />

comportement est i<strong>de</strong>ntique à la propriété <strong>du</strong> text. Vous pouvez indiquer qu'un champ texte<br />

est un champ texte HTML dans l'inspecteur <strong>de</strong>s propriétés ou en définissant la propriété html<br />

<strong>du</strong> champ texte sur true.<br />

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

Exemple<br />

L'exemple suivant crée un champ texte qui définit la propriété html sur true. Le texte au<br />

format HTML s'affiche dans le champ texte.<br />

this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160,<br />

22);<br />

my_txt.html = true;<br />

my_txt.htmlText = " this is bold text ";<br />

La métho<strong>de</strong> MovieClip.getNextHighestDepth() utilisée dans cet exemple requiert Flash<br />

Player 7 ou version ultérieure. Si votre fichier SWF comporte un composant <strong>de</strong> la version 2,<br />

utilisez la classe DepthManager <strong>de</strong>s composants <strong>de</strong> la version 2 au lieu <strong>de</strong> la métho<strong>de</strong><br />

MovieClip.getNextHighestDepth().<br />

Voir également<br />

html (propriété TextField.html), Protocole asfunction<br />

length (propriété TextField.length)<br />

longueur publique : Number [lecture seule]<br />

Indique le nombre <strong>de</strong> caractères d'un champ texte. Cette propriété renvoie la même valeur<br />

que text.length, mais est plus rapi<strong>de</strong>. Un caractère tel que tab (\t) compte comme un seul<br />

caractère.<br />

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

Exemple<br />

L'exemple suivant renvoie le nombre <strong>de</strong> caractères <strong>du</strong> champ texte date_txt text field, ce qui<br />

affiche la date actuelle.<br />

var today:Date = new Date();<br />

this.createTextField("date_txt", this.getNextHighestDepth(), 10, 10, 100,<br />

22);<br />

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

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

Saved successfully!

Ooh no, something went wrong!