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.

Voir également<br />

bytesTotal (propriété NetStream.bytesTotal), bufferLength (propriété<br />

NetStream.bufferLength)<br />

bytesTotal (propriété NetStream.bytesTotal)<br />

public bytesTotal : Nombre [lecture seule]<br />

La taille totale, en octets, <strong>du</strong> fichier chargé dans le lecteur.<br />

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

Exemple<br />

L'exemple suivant crée une barre <strong>de</strong> progression avec l'API <strong>de</strong> <strong>de</strong>ssin, ainsi que les propriétés<br />

bytesLoa<strong>de</strong>d et bytesTotal qui affichent la progression <strong>du</strong> chargement <strong>de</strong> vi<strong>de</strong>o1.flv dans<br />

l'occurrence d'objet vidéo appelé my_vi<strong>de</strong>o. Un champ texte appelé loa<strong>de</strong>d_txt est créé <strong>de</strong><br />

façon dynamique pour afficher également <strong>de</strong>s informations sur la progression <strong>du</strong> processus <strong>de</strong><br />

chargement.<br />

var connection_nc:NetConnection = new NetConnection();<br />

connection_nc.connect(null);<br />

var stream_ns:NetStream = new NetStream(connection_nc);<br />

my_vi<strong>de</strong>o.attachVi<strong>de</strong>o(stream_ns);<br />

stream_ns.play("vi<strong>de</strong>o1.flv");<br />

this.createTextField("loa<strong>de</strong>d_txt", this.getNextHighestDepth(), 10, 10, 160,<br />

22);<br />

this.createEmptyMovieClip("progressBar_mc", this.getNextHighestDepth());<br />

progressBar_mc.createEmptyMovieClip("bar_mc",<br />

progressBar_mc.getNextHighestDepth());<br />

with (progressBar_mc.bar_mc) {<br />

beginFill(0xFF0000);<br />

moveTo(0, 0);<br />

lineTo(100, 0);<br />

lineTo(100, 10);<br />

lineTo(0, 10);<br />

lineTo(0, 0);<br />

endFill();<br />

_xscale = 0;<br />

}<br />

progressBar_mc.createEmptyMovieClip("stroke_mc",<br />

progressBar_mc.getNextHighestDepth());<br />

with (progressBar_mc.stroke_mc) {<br />

lineStyle(0, 0x000000);<br />

moveTo(0, 0);<br />

lineTo(100, 0);<br />

lineTo(100, 10);<br />

lineTo(0, 10);<br />

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

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

Saved successfully!

Ooh no, something went wrong!