Microphone silenceLevel [AS 2]
Klasa: Microphone
Kompatybilność: ActionScript 1.0, Flash 6+
Liczba określająca ilość potrzebnego dźwięku aby zaktywować mikrofon oraz wywołać Microphone.onActivity(true)
.
Domyślna wartość to 10.
Listing
var silenceLevel_pb:mx.controls.ProgressBar;
var silenceLevel_nstep:mx.controls.NumericStepper;
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
silenceLevel_pb.label = "Activity level: %3";
silenceLevel_pb.mode = "manual";
silenceLevel_nstep.minimum = 0;
silenceLevel_nstep.maximum = 100;
silenceLevel_nstep.value = active_mic.silenceLevel;
var nstepListener:Object = new Object();
nstepListener.change = function(evt:Object) {
active_mic.setSilenceLevel(evt.target.value, active_mic.silenceTimeOut);
};
silenceLevel_nstep.addEventListener("change", nstepListener);
this.onEnterFrame = function() {
silenceLevel_pb.setProgress(active_mic.activityLevel, 100);
};
active_mic.onActivity = function(active:Boolean) {
if (active) {
silenceLevel_pb.indeterminate = false;
silenceLevel_pb.setStyle("themeColor", "haloGreen");
silenceLevel_pb.label = "Activity level: %3";
} else {
silenceLevel_pb.indeterminate = true;
silenceLevel_pb.setStyle("themeColor", "0xFF0000");
silenceLevel_pb.label = "Activity level: (inactive)";
}
};
var silenceLevel_nstep:mx.controls.NumericStepper;
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth());
var active_mic:Microphone = Microphone.get();
sound_mc.attachAudio(active_mic);
silenceLevel_pb.label = "Activity level: %3";
silenceLevel_pb.mode = "manual";
silenceLevel_nstep.minimum = 0;
silenceLevel_nstep.maximum = 100;
silenceLevel_nstep.value = active_mic.silenceLevel;
var nstepListener:Object = new Object();
nstepListener.change = function(evt:Object) {
active_mic.setSilenceLevel(evt.target.value, active_mic.silenceTimeOut);
};
silenceLevel_nstep.addEventListener("change", nstepListener);
this.onEnterFrame = function() {
silenceLevel_pb.setProgress(active_mic.activityLevel, 100);
};
active_mic.onActivity = function(active:Boolean) {
if (active) {
silenceLevel_pb.indeterminate = false;
silenceLevel_pb.setStyle("themeColor", "haloGreen");
silenceLevel_pb.label = "Activity level: %3";
} else {
silenceLevel_pb.indeterminate = true;
silenceLevel_pb.setStyle("themeColor", "0xFF0000");
silenceLevel_pb.label = "Activity level: (inactive)";
}
};
Dodano przez: divix
Ranga: Administrator serwisu Punktów: 0
Ranga: Administrator serwisu Punktów: 0
Komentarze użytkowników
:: Losowe artykuły
:: Wymiana linków
Modowe inspiracje |
Android Gry i Aplikacje |
ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
Logo dla firmy |
Change Tires - Car Weather Forecast Reminder |
Laminas: MVC Framework for PHP |
IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS |
Katalog roślin |
Programming articles: JAVA, PHP, C++, Python, JavaScript |
Kancelaria Adwokacka Łukasz Huszno