03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Returns<br />

Microphone -<br />

■ If index is not specified, this method returns a reference to the default microphone or, if it<br />

is not available, to the first available microphone. If no microphones are available or<br />

installed, the method returns null.<br />

■ If index is specified, this method returns a reference to the requested microphone, or<br />

null if it is not available.<br />

Example<br />

The following example lets the user specify the default microphone, <strong>and</strong> then captures audio<br />

<strong>and</strong> plays it back locally. To avoid feedback, you may want to test this code while wearing<br />

headphones.<br />

this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());<br />

System.showSettings(2);<br />

var active_mic:Microphone = Microphone.get();<br />

sound_mc.attachAudio(active_mic);<br />

The MovieClip.getNextHighestDepth() method used in this example requires Flash Player<br />

7 or later. If your SWF file includes a version 2 component, use the version 2 components'<br />

DepthManager class instead of the MovieClip.getNextHighestDepth() method.<br />

See also<br />

get (Microphone.get method), index (Microphone.index property), muted<br />

(Microphone.muted property), names (Microphone.names property), onStatus<br />

(Microphone.onStatus h<strong>and</strong>ler), attachAudio (MovieClip.attachAudio method),<br />

showSettings (System.showSettings method)<br />

index (Microphone.index property)<br />

public index : Number [read-only]<br />

A zero-based integer that specifies the index of the microphone, as reflected in the array<br />

returned by Microphone.names.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Example<br />

The following example displays the names of the sound capturing devices available on your<br />

computer system in a ComboBox instance called mic_cb. An instance of the Label<br />

component, called mic_lbl, displays the index microphone. You can use the ComboBox to<br />

switch between the devices.<br />

800 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!