Onactivity (Microphone.onactivity Handler) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

You have 2 device(s) installed.
[0] Logitech USB Headset
[1] YAMAHA AC-XG WDM Audio
See also
name (Microphone.name property)

onActivity (Microphone.onActivity handler)

onActivity = function(active:Boolean) {}
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
amount of time that must elapse without sound before
invoked, use
Microphone.setSilenceLevel()
Availability: ActionScript 1.0; Flash Player 6
Parameters
- A Boolean value set to true when the microphone starts detecting sound,
active:Boolean
and false when it stops.
Example
The following example displays the amount of activity level in a ProgressBar instance called
. When the microphone detects sound, it invokes the
activityLevel_pb
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);
active_mic.onActivity = function(active:Boolean) {
if (active) {
activityLevel_pb.indeterminate = false;
activityLevel_pb.label = "Activity Level: %3%%";
} else {
activityLevel_pb.indeterminate = true;
activityLevel_pb.label = "Activity Level: (inactive)";
}
};
this.onEnterFrame = function() {
activityLevel_pb.setProgress(active_mic.activityLevel, 100);
};
,
get (Microphone.get method)
Microphone.onActivity(true)
Microphone.onActivity(false)
.
, and the
is
onActivity
Microphone
793

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF