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.

var active_mic:Microphone = Microphone.get();<br />

sound_mc.attachAudio(active_mic);<br />

activityLevel_pb.mo<strong>de</strong> = "manual";<br />

activityLevel_pb.label = "Activity Level: %3";<br />

useEchoSuppression_ch.selected = active_mic.useEchoSuppression;<br />

this.onEnterFrame = function() {<br />

activityLevel_pb.setProgress(active_mic.activityLevel, 100);<br />

};<br />

var chListener:Object = new Object();<br />

chListener.click = function(evt:Object) {<br />

active_mic.setUseEchoSuppression(evt.target.selected);<br />

};<br />

useEchoSuppression_ch.addEventListener("click", chListener);<br />

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

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

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

MovieClip.getNextHighestDepth().<br />

Voir également<br />

setUseEchoSuppression (métho<strong>de</strong> microphone.setUseEchoSuppression),<br />

useEchoSuppression (propriété Microphone.useEchoSuppression)<br />

silenceLevel (propriété Microphone.silenceLevel)<br />

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

Entier spécifiant le volume sonore requis pour activer le microphone et invoquer<br />

Microphone.onActivity(true). La valeur par défaut est 10.<br />

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

Exemple<br />

L'exemple suivant modifie le niveau <strong>de</strong> silence en fonction <strong>de</strong> l'entrée <strong>de</strong> l'utilisateur dans une<br />

occurrence NumericStepper intitulée silenceLevel_nstep. L'occurrence ProgressBar<br />

intitulée silenceLevel_pb modifie son aspect selon que le flux continu est considéré comme<br />

étant silencieux ou non. Sinon, elle affiche le niveau d'activité <strong>du</strong> flux continu.<br />

var silenceLevel_pb:mx.controls.ProgressBar;<br />

var silenceLevel_nstep:mx.controls.NumericStepper;<br />

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

var active_mic:Microphone = Microphone.get();<br />

sound_mc.attachAudio(active_mic);<br />

silenceLevel_pb.label = "Activity level: %3";<br />

Microphone 827

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

Saved successfully!

Ooh no, something went wrong!