本文介绍了Flex的动作$ C $下activitylevel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何一个indicata我一小块code使这一进度条举措的麦克风activitylevel即可。即,当所说的麦克风上的进度应指明it.Also该工程的 Internet Explorer中
< XML版本=1.0编码=UTF-8&GT?;
< MX:应用
的xmlns:MX =http://www.adobe.com/2006/mxml
布局=绝对
WIDTH =300
高度=100
的creationComplete =的init()>
< MX:脚本>
<![CDATA [
进口mx.controls.Alert;
进口flash.net.NetStream在;
私人VAR myMic:麦克风;
私人VAR recordingState:字符串=空转;
私有函数的init():无效{
myMic = Microphone.getMicrophone();
myMic.setSilenceLevel(0);
myMic.rate = 44;
myMic.gain = 100;
micLevel.visible = TRUE;
Security.showSettings(SecurityPanel.MICROPHONE);
myMic.setLoopBack(真正的);
如果(myMic!= NULL)
{
myMic.setUseEchoSup pression(真正的);
micLevel.setProgress(myMic.activityLevel,100);
的addEventListener(Event.ENTER_FRAME,showMicLevel);
//micLevel.setProgress(myMic.activityLevel,100);
}
}
]]≥
< / MX:脚本>
< MX:进度条X =0Y =36模式=手动ID =micLevel标签=将labelPlacement =底部WIDTH =100fontSize的=10的fontWeight =正常/ >
< / MX:用途>
解决方案
您需要添加一个回调函数的事件。你把它定义为showMicLevel,但你没有实现的功能。
私有函数showMicLevel(五:事件):无效{
micLevel.setProgress(myMic.activityLevel,100);
}
Can any one indicata me a small piece of code for making this progress bar move on mic activitylevel. i.e, When spoken on the microphone the progressbar should indicate it.Also which works on internet explorer
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
width="300"
height="100"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import flash.net.NetStream;
private var myMic:Microphone;
private var recordingState:String = "idle";
private function init():void {
myMic = Microphone.getMicrophone();
myMic.setSilenceLevel(0);
myMic.rate = 44;
myMic.gain = 100;
micLevel.visible = true;
Security.showSettings(SecurityPanel.MICROPHONE);
myMic.setLoopBack(true);
if (myMic != null)
{
myMic.setUseEchoSuppression(true);
micLevel.setProgress(myMic.activityLevel, 100);
addEventListener(Event.ENTER_FRAME, showMicLevel);
//micLevel.setProgress(myMic.activityLevel, 100);
}
}
]]>
</mx:Script>
<mx:ProgressBar x="0" y="36" mode="manual" id="micLevel" label="" labelPlacement="bottom" width="100" fontSize="10" fontWeight="normal"/>
</mx:Application>
解决方案
You need to add a callback function for the event. You have it defined as showMicLevel but you have no implementation of that function.
private function showMicLevel(e: Event):void{
micLevel.setProgress(myMic.activityLevel, 100);
}
这篇关于Flex的动作$ C $下activitylevel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!