Example
The following example displays the activity level of the current microphone in a ProgressBar
instance called
activityLevel_pb
var activityLevel_pb:mx.controls.ProgressBar;
activityLevel_pb.mode = "manual";
activityLevel_pb.label = "Activity Level: %3%%";
activityLevel_pb.setStyle("themeColor", "0xFF0000");
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
this.onEnterFrame = function() {
activityLevel_pb.setProgress(active_mic.activityLevel, 100);
};
active_mic.onActivity = function(active:Boolean) {
if (active) {
var haloTheme_str:String = "haloGreen";
} else {
var haloTheme_str:String = "0xFF0000";
}
activityLevel_pb.setStyle("themeColor", haloTheme_str);
};
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
get (Microphone.get method)
,
method)
setGain (Microphone.setGain method)
gain (Microphone.gain property)
public gain : Number [read-only]
The amount by which the microphone boosts the signal. Valid values are 0 to 100. The
default value is 50.
Availability: ActionScript 1.0; Flash Player 6
Example
The following example uses a ProgressBar instance called
NumericStepper instance called
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
.
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
,
setSilenceLevel (Microphone.setSilenceLevel
to set the microphone's gain value.
gain_nstep
method.
to display and a
gain_pb
Microphone
787
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?