466 Chapter 12: ActionScript Dictionary
Example
The following example lets the user specify the default microphone, then captures audio and plays
it back locally. To avoid feedback, you may want to test this code while wearing headphones.
System.showSettings(2);
myMic = Microphone.get();
_root.attachAudio(myMic);
See also
Microphone.index
, Microphone.muted, Microphone.names, Microphone.onStatus,
MovieClip.attachAudio()
Microphone.index
Availability
Flash Player 6.
Usage
activeMicrophone.index
Description
Read-only property; a zero-based integer that specifies the index of the microphone, as reflected
in the array returned by
Microphone.names.
See also
Microphone.get()
, Microphone.names
Microphone.muted
Availability
Flash Player 6.
Usage
activeMicrophone.muted
Description
Read-only property; a Boolean value that specifies whether the user has denied access to the
microphone (
true) or allowed access (false). When this value changes, Microphone.onStatus
is invoked. For more information, see
Microphone.get().
Example
In the following example, when the user clicks the button, Flash publishes and plays a live stream
if the microphone is not muted.
on (press)
{
// If the user mutes microphone, display offline notice.
// Else, publish and play live stream from microphone.
if(myMic.muted) {
_root.debugWindow+="Microphone offline." + newline;
} else {