EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Gain (Microphone.gain Property)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Microphone 787
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() method used in this example requires Flash Player
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
MovieClip.getNextHighestDepth() method.
See also
get (Microphone.get method), setSilenceLevel (Microphone.setSilenceLevel
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
gain_pb to display and a
NumericStepper instance called
gain_nstep to set the microphone's gain value.
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);

Table of Contents

Related product manuals