Microphone.onActivity
541
status_ta.text += "You have "+microphone_array." device(s)
installed."+newline;
for (var i = 0; i<microphone_array.length; i++) {
status_ta.text += "["+i+"] "+microphone_array[i]+newline;
}
For example, the following information could be displayed:
The default device is: Logitech USB Headset
You have 2 device(s) installed.
[0] Logitech USB Headset
[1] YAMAHA AC-XG WDM Audio
See also
Array class
,
Microphone.name
Microphone.onActivity
Availability
Flash Player 6.
Usage
active_mic
.onActivity = function(
activity:Boolean
)
: Void
{
// your statements here
}
Parameters
activity
A Boolean value set to
true
when the microphone starts detecting sound, and
false
when it stops.
Returns
Nothing.
Description
Event handler; invoked when the microphone starts or stops detecting sound. If you want to
respond to this event handler, you must create a function to process its
activity
value.
To specify the amount of sound required to invoke
Microphone.onActivity(true)
, and the
amount of time that must elapse without sound before
Microphone.onActivity(false)
is
invoked, use
Microphone.setSilenceLevel()
.
Example
The following example displays the amount of activity level in a ProgressBar instance called
activityLevel_pb
. When the microphone detects sound, it invokes the
onActivity
function,
which modifies the ProgressBar instance.
var activityLevel_pb:mx.controls.ProgressBar;
activityLevel_pb.mode = "manual";
activityLevel_pb.label = "Activity Level: %3%%";
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
Содержание FLEX-FLEX ACTIONSCRIPT LANGUAGE
Страница 1: ...Flex ActionScript Language Reference...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Страница 135: ...case 135 See also break default strict equality switch...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in...
Страница 808: ...808 Chapter 7 ActionScript for Flash...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Страница 822: ...822 Index...