538
Chapter 7: ActionScript for Flash
The user can also specify permanent privacy settings for a particular domain by right-clicking
(Windows) or Control-clicking (Macintosh) while a SWF file is playing, choosing Settings,
opening the Privacy panel, and selecting Remember.
You can’t use ActionScript to set the Allow or Deny value for a user, but you can display the
Privacy panel for the user by using
System.showSettings(0)
. If the user selects Remember,
Flash Player no longer displays the Privacy dialog box for SWF files from this domain.
If
Microphone.get()
returns
null
, either the microphone is in use by another application, or
there are no microphones installed on the system. To determine whether any microphones are
installed, use
Microphones.names.length
. To display the Flash Player Microphone Settings
panel, which lets the user choose the microphone to be referenced by
Microphone.get()
, use
System.showSettings(2)
.
Example
The following example lets the user specify the default microphone, and then captures audio and
plays it back locally. To avoid feedback, you may want to test this code while wearing headphones.
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
System.showSettings(2);
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
See also
Microphone.index
,
Microphone.muted
,
Microphone.names
,
Microphone.onStatus
,
MovieClip.attachAudio()
,
System.showSettings()
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
mic_cb
. An instance of the Label component,
called
mic_lbl
, displays the index microphone. You can use the ComboBox to 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);
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...