User Guide

788 ActionScript classes
gain_pb.label = "Gain: %3";
gain_pb.mode = "manual";
gain_pb.setProgress(active_mic.gain, 100);
gain_nstep.value = active_mic.gain;
function changeGain() {
active_mic.setGain(gain_nstep.value);
gain_pb.setProgress(active_mic.gain, 100);
}
gain_nstep.addEventListener("change", changeGain);
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
setGain (Microphone.setGain method)
get (Microphone.get method)
public static get([index:Number]) : Microphone
Returns a reference to a Microphone object for capturing audio. To actually begin capturing
the audio, you must attach the Microphone object to a MovieClip object (see
MovieClip.attachAudio()).
Unlike objects that you create using the
new constructor, multiple calls to Microphone.get()
reference the same microphone. Thus, if your script contains the lines
mic1 =
Microphone.get()
and mic2 = Microphone.get(), both mic1 and mic2 reference the same
(default) microphone.
In general, you shouldn't pass a value for
index; simply use the Microphone.get() method
to return a reference to the default microphone. By means of the Microphone settings panel
(discussed later in this section), the user can specify the default microphone Flash should use.
If you pass a value for
index, you might be trying to reference a microphone other than the
one the user prefers. You might use
index in rare cases--for example, if your application is
capturing audio from two microphones at the same time.
When a SWF file tries to access the microphone returned by the
Microphone.get() method-
-for example, when you issue
MovieClip.attachAudio()--Flash Player displays a Privacy
dialog box that lets the user choose whether to allow or deny access to the microphone. (Make
sure your Stage size is at least 215 x 138 pixels; this is the minimum size Flash requires to
display the dialog box.)