this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
silenceLevel_pb.label = "Activity level: %3";
silenceLevel_pb.mode = "manual";
silenceTimeOut_nstep.minimum = 0;
silenceTimeOut_nstep.maximum = 10;
silenceTimeOut_nstep.value = active_mic.silenceTimeOut/1000;
var nstepListener:Object = new Object();
nstepListener.change = function(evt:Object) {
active_mic.setSilenceLevel(active_mic.silenceLevel, evt.target.value
1000);
};
silenceTimeOut_nstep.addEventListener("change", nstepListener);
this.onEnterFrame = function() {
silenceLevel_pb.setProgress(active_mic.activityLevel, 100);
};
active_mic.onActivity = function(active:Boolean) {
if (active) {
silenceLevel_pb.indeterminate = false;
silenceLevel_pb.setStyle("themeColor", "haloGreen");
silenceLevel_pb.label = "Activity level: %3";
} else {
silenceLevel_pb.indeterminate = true;
silenceLevel_pb.setStyle("themeColor", "0xFF0000");
silenceLevel_pb.label = "Activity level: (inactive)";
}
};
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
See also
setSilenceLevel (Microphone.setSilenceLevel method)
useEchoSuppression
(Microphone.useEchoSuppression property)
public useEchoSuppression : Boolean [read-only]
Property (read-only); a Boolean value of
The default value is
false
Microphone Settings panel.
804
ActionScript classes
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
if echo suppression is enabled,
true
unless the user has selected Reduce Echo in the Flash Player
method.
otherwise.
false
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?