Microphone.index - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

Microphone.index

Availability
Flash Player 6.
Usage
active_mic.index:Number
Description
Read-only property; a zero-based integer that specifies the index of the microphone, as reflected
in the array returned by Microphone.names.
Example
The following example displays the names of the sound capturing devices available on your
computer system in a ComboBox instance called
called
, displays the index microphone. You can use the ComboBox to switch between
mic_lbl
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);
See also
Microphone.get(),
Microphone.names
. An instance of the Label component,
mic_cb
Microphone.index
453

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash mx

Table of Contents