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.

Voir également<br />

loadSound (métho<strong>de</strong> Sound.loadSound)<br />

onSoundComplete (gestionnaire<br />

Sound.onSoundComplete)<br />

onSoundComplete = function() {}<br />

Appelé automatiquement lorsque la lecture d'un son est finie. Vous pouvez utiliser ce<br />

gestionnaire pour déclencher les événements dans un fichier SWF lorsqu'un son s'arrête.<br />

Vous <strong>de</strong>vez créer une fonction qui s'exécute lorsque ce gestionnaire est appelé. Vous pouvez<br />

utiliser une fonction anonyme ou une fonction nommée.<br />

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

Exemple<br />

Usage 1 : L'exemple suivant utilise une fonction anonyme :<br />

var my_sound:Sound = new Sound();<br />

my_sound.attachSound("mySoundID");<br />

my_sound.onSoundComplete = function() {<br />

trace("mySoundID completed");<br />

};<br />

my_sound.start();<br />

Usage 2 : L'exemple suivant utilise une fonction nommée :<br />

function callback1() {<br />

trace("mySoundID completed");<br />

}<br />

var my_sound:Sound = new Sound();<br />

my_sound.attachSound("mySoundID");<br />

my_sound.onSoundComplete = callback1;<br />

my_sound.start();<br />

Voir également<br />

onLoad (gestionnaire Sound.onLoad)<br />

position (Sound.position, propriété)<br />

public position : Number [lecture seule]<br />

La <strong>du</strong>rée <strong>de</strong> diffusion <strong>du</strong> son exprimée en millisecon<strong>de</strong>s. Si le son est lu en boucle, la position<br />

est réinitialisée sur 0 au début <strong>de</strong> chaque boucle.<br />

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

Sound 1151

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

Saved successfully!

Ooh no, something went wrong!