var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
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)
(Microphone.muted property)
(Microphone.onStatus handler)
showSettings (System.showSettings method)
index (Microphone.index property)
public index : Number [read-only]
A zero-based integer that specifies the index of the microphone, as reflected in the array
returned by
Microphone.names
Availability: ActionScript 1.0; Flash Player 6
Example
The following example displays the names of the sound capturing devices available on your
computer system in a ComboBox instance called
component, called
mic_lbl
switch between the devices.
var mic_lbl:mx.controls.Label;
var mic_cb:mx.controls.ComboBox;
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
mic_lbl.text = "["+active_mic.index+"] "+active_mic.name;
mic_cb.dataProvider = Microphone.names;
mic_cb.selectedIndex = active_mic.index;
var cbListener:Object = new Object();
cbListener.change = function(evt:Object) {
active_mic = Microphone.get(evt.target.selectedIndex);
sound_mc.attachAudio(active_mic);
mic_lbl.text = "["+active_mic.index+"] "+active_mic.name;
};
mic_cb.addEventListener("change", cbListener);
790
ActionScript classes
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
,
index (Microphone.index property)
,
names (Microphone.names property)
,
attachAudio (MovieClip.attachAudio method)
.
, displays the index microphone. You can use the ComboBox to
. An instance of the Label
mic_cb
method.
,
muted
,
onStatus
,
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?
Questions and answers